ASCII Art – Challenge | Coding Like A Grekz

Coding like a Grekz | Uy turrun tun tun Programación en Java y cosillas Home > Beyond, CodinGame, Java, snippets > ASCII Art – Challenge

ASCII Art – Challenge

November 17, 2015 Leave a comment Go to comments

This is the solution of the ASCII Art problem in the CodinGame page. https://www.codingame.com/games/puzzles

import java.util.*; import java.io.*; import java.math.*;

/** @author Juan Mendoza grekz.wordpress.com * ASCII art allows you to represent forms by using characters. To be precise, in our case, these forms are words. For example, the word “MANHATTAN” could be displayed as follows in ASCII art: * * # # # ### # # # ### ### # ### * ### # # # # # # # # # # # # # # * ### ### # # ### ### # # ### # # * # # # # # # # # # # # # # # # # * # # # # # # # # # # # # # # # # * * Your mission is to write a program that can display a line of text in ASCII art. **/ class Solution {

public static void main(String args[]) {    Scanner in = new Scanner(System.in);    int L = in.nextInt();    in.nextLine();    int H = in.nextInt();    in.nextLine();    String T = in.nextLine().toUpperCase();    String [][] chars= new String[27][H];    for (int i = 0; i < H; i++) {        String ROW = in.nextLine();        for(int j = 0; j < 27; j++){            chars[j][i] = ROW.substring(j*L, (j+1) * L);        }    }    for (int i = 0; i < H; i++) {         for(char x : T.toCharArray() ){             x -= 65;             if(x < 0 || x > 26) x = 26;             System.out.print(chars[x][i]);         }         System.out.println();     }   } }

Share this:

  • Facebook
  • X
Like Loading...

Related

Categories: Beyond, CodinGame, Java, snippets Comments (0) Trackbacks (0) Leave a comment Trackback
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment Cancel reply

Δ

Unary encoded for 7-bit ASCII Simplify a fraction in Java RSS feed

Suuuuuuuuuscrebaseee

Escribe tu mail para recibir notificaciones ;)

Email Address:

Sign me up!

Join 4 other subscribers

Twittea acá!

Tweets by el_grekz

Los posts más populares!

  • npm ci task - ERR! string.prototype.trimend not accessible from es-abstract
  • Good-to-great - Key points - The flywheel and the doom loop
  • Good-to-great - Key points - Technology accelerators
  • Good-to-great - Key points - A culture of discipline

Nuestras categorías son...

Algoritmo Arte Beyond Diseño Diversion Educación Golang idiomas Java JavaScript JSF leetcode Mini-tips Oracle plsql pregunta diaria Programación Python ruby Scala snippets SQL Tips Uncategorized Web

Etiquetas más usadas

alemán alternativo Arte ascii ascii to char best time to buy and sell stock CEOs chiste Code Codigo codingame contains duplicate CSS duplicated elements easy excel column FacesContext fenómeno francés Frases en otros idiomas Genghis Khan git go Golang goldbach conjecture good-to-great google hamming distance hard HTML httpserver HttpServletRequest idiomas inglés italiano java java ascii javascript Java Server Faces jQuery js JSF keypoints kotlin leetcode Linux List medium Merge Lists Mitología griega MySQL nada Oracle oracle db oracle sql Pascal triangle performance pots programa java Python python3 query remo res ruby rómulo Scala siglo de oro simplehttpserver SMS solution SQL string string manipulation Valid Parentheses Top Blog at WordPress.com.
  • Comment
  • Reblog
  • Subscribe Subscribed
    • Coding like a Grekz | Uy turrun tun tun
    • Sign me up
    • Already have a WordPress.com account? Log in now.
    • Coding like a Grekz | Uy turrun tun tun
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar
%d Design a site like this with WordPress.comGet started

Tag » Codingame Ascii Art Solution Python