Javascript required
Skip to content Skip to sidebar Skip to footer

Print Out an Ascii Art Tree to the Javascript Console

The Goal

In stations and airports you lot ofttimes see this type of screen:

Take y'all ever asked yourself how it might be possible to simulate this display on a good old concluding? We have: with ASCII art!

Rules

ASCII art allows you to correspond forms by using characters. To exist precise, in our case, these forms are words. For example, the word "MANHATTAN" could be displayed as follows in ASCII fine art:

# #  #  ### # #  #  ### ###  #  ### ### # # # # # # # #  #   #  # # # # ### ### # # ### ###  #   #  ### # # # # # # # # # # # #  #   #  # # # # # # # # # # # # # #  #   #  # # # #

Your mission is to write a program that tin can display a line of text in ASCII fine art in a way yous are given as input.

Game Input

Input

Line 1: the width L of a letter represented in ASCII fine art. All letters are the same width.

Line 2: the pinnacle H of a letter represented in ASCII art. All letters are the aforementioned pinnacle.

Line 3: The line of text T, equanimous of N ASCII characters.

Following lines: the string of characters ABCDEFGHIJKLMNOPQRSTUVWXYZ? Represented in ASCII art.

Output

The text T in ASCII art.
The characters a to z are shown in ASCII art by their equivalent in upper instance.
The characters that are not in the intervals [a-z] or [A-Z] will be shown as a question mark in ASCII fine art.

Constraints

0 < L < xxx
0 < H < xxx
0 < N < 200

Example 1

Input

4 5 Eastward  #  ##   ## ##  ### ###  ## # # ###  ## # # #   # # ###  #  ##   #  ##   ## ### # # # # # # # # # # ### ### # # # # #   # # #   #   #   # #  #    # # # #   ### # # # # # # # # # # #    #  # # # # # # # # # #   #   # ### ##  #   # # ##  ##  # # ###  #    # ##  #   ### # # # # ##  # # ##   #   #  # # # # ###  #   #   #   ## # # # # #   # # #   #   # # # #  #  # # # # #   # # # # # # #    ## # #   #  #  # # # # ### # #  #  # # # ##   ## ##  ### #    ## # # ###  #  # # ### # # # #  #  #     # # # ##   #  ###  #  # # # #  #  ###  #              

Instance 2

Input

4 5 MANHATTAN  #  ##   ## ##  ### ###  ## # # ###  ## # # #   # # ###  #  ##   #  ##   ## ### # # # # # # # # # # ### ### # # # # #   # # #   #   #   # #  #    # # # #   ### # # # # # # # # # # #    #  # # # # # # # # # #   #   # ### ##  #   # # ##  ##  # # ###  #    # ##  #   ### # # # # ##  # # ##   #   #  # # # # ###  #   #   #   ## # # # # #   # # #   #   # # # #  #  # # # # #   # # # # # # #    ## # #   #  #  # # # # ### # #  #  # # # ##   ## ##  ### #    ## # # ###  #  # # ### # # # #  #  #     # # # ##   #  ###  #  # # # #  #  ###  #                

Output

# #  #  ### # #  #  ### ###  #  ### ### # # # # # # # #  #   #  # # # # ### ### # # ### ###  #   #  ### # # # # # # # # # # # #  #   #  # # # # # # # # # # # # # #  #   #  # # # #                

We could write the alphabet in an assortment and look it up there. A much better way is reading in the first line of the alphabet and generate the output directly for the string nosotros desire to print:

marryatcaladving.blogspot.com

Source: https://www.xarg.org/puzzle/codingame/ascii-art/