Now it's time for us to test you. Mwa ha ha ha.
You may have attempted Banner Print, a program designed to take a given
String and turn it into a HUGE print of uniform letters. Now, your job will
be to go backwards, and uniformity is not guaranteed.
First, you will be given a dictionary of character arrays. Each array
represents a character. For example,
A
...XX...
..XXXX..
.XX..XX.
.XX..XX.
.XX..XX.
.XXXXXX.
.XX..XX.
.XX..XX.
.XX..XX.
Shows first that A will be stored, and secondly it gives the dictionary array representation of A.
Your job will be to determine a word message based on the input as described
below.
Input Format
A line containing all the background characters, followed by a line
containing all the possible foreground characters. The following lines
will contain a single character followed by an 8 character wide by 9 character
tall grid representing the character that just appeared. There may be more
than one but not more than 50 character definitions and they will be followed
by the keyword "begin", following this keyword is a line of the character
grids that must be interpreted. If there are more sets each will have the
keyword "begin" on the line following the grid if the keyword "end" is encountered
there is no more input. Each set should be output with a new line after them.
All the letters used in the message will be provided as input definitions
a space character will not be used in the messages as a character definition
nor will it be used in the foreground or background character lists.
Please note that in the example below of the input, the X's may be any
character that is listed in the line containing foreground characters, the
period's may be any character in the background list (for example of these
please look at the definition of B above), there will be no escape characters
or extended ASCII. The input was shortened for example purposes only, all
definitions used in the message will be defined in the input file.
The input file will be called jin14.txt.
Output Format
For each set your program will print out the letter that was associated
with the definition in the message.
#.,*+~
1234567890-=!@$%^&()_QVWERTYUIOP[]{}|ASDFGHJKL;ZXCVBNM<>/?
A
...XX...
..XXXX..
.XX..XX.
.XX..XX.
.XX..XX.
.XXXXXX.
.XX..XX.
.XX..XX.
.XX..XX.
B
,M@ST$.,
~BT.,B@.
+V$,*NG+
+})++5Q#
*NU1J0~*
#TR~.B=.
~2>,~?N*
~VK#*%K+
+$|HNR*#
begin
.XX..XX..XXXXXX..XX......XX.......XXXX..
.XX..XX..XX......XX......XX......XX..XX.
.XX..XX..XX......XX......XX......XX..XX.
.XX..XX..XX......XX......XX......XX..XX.
.XXXXXX..XXXXX...XX......XX......XX..XX.
.XX..XX..XX......XX......XX......XX..XX.
.XX..XX..XX......XX......XX......XX..XX.
.XX..XX..XX......XX......XX......XX..XX.
.XX..XX..XXXXXX..XXXXXX..XXXXXX...XXXX..
end
HELLO