Problem B
Painting with CSE
Input:
standard
input
Output: standard output
Time Limit: 4 seconds
A software development company
near Polashi, Dhaka is famous for their product Bitmap Update
& Editing Tool (BUET). This software uses text commands to
draw objects. A subset of the text commands is used in drawing straight lines
and rectagles. This subset is known as Compound String Expression
for Drawing, Editing & Plotting recTangles (CSE
DEPT).
The CSE commands has the following elements:
Given a list expression, you are to draw the bitmap in the format shown in the sample. Spaces are allowed in the input. Pixels having x or y less than 0 or grater than 9 are to be ignored.
Input consists of several input strings, one in
each line. The end of input is marked with a line consisting of a single '#' mark. Input may contain any character,
but all except the ones mentioned above indicates error. Input can be upto 120
characters long. Integers can be negative. You can assume that there will be at
most 20 points in any object, and at most 20 objects in any list.
For each dataset, print the set number(1,2,...)
in a line followed by the 10*10 bitmap. Lower left corner is the pixel (0,0). A
blank is marked by a dot, while a dark pixel is marked by a hash sign. An error
in input should result in a bitmap having a question mark at the pixel (0,0).
[(0,0),(1,0)] u R( 90, [(2,0),(5,0)] )
[(0,0),(1,0)] u T( 5,5, [(0,0)] u [(1,0)] u A([(2,0),(5,0)],[(5,0),(5,5)]) )
T( 5,5, S(2,2 2, [(0,0),(1,0)] ))
T( 5,5, R( 90, S(2,2, [(0,0),(1,0)] )) )
#
Set #1
..........
..........
..........
..........
#.........
#.........
#.........
#.........
..........
##........
Set #2
..........
..........
..........
..........
.....#####
..........
..........
..........
..........
##........
Set #3
..........
..........
..........
..........
..........
..........
..........
..........
..........
?.........
Set #4
..........
..........
.....#....
.....#....
.....#....
..........
..........
..........
..........
..........
Mustaq
Ahmed