28
6
Objective: Write a program that generates beautiful (?) ASCII-art landscapes and skylines!
Your program has just one input: a string composed of any combination/repetition of the chars 0123456789abc
.
For each input character, output a vertical line composed as follows:
.
..
...
oooo
ooooo
OOOOOO
OOOOOOO
XXXXXXXX
XXXXXXXXX
XXXXXXXXXX
0123456789
Letters abc
instead are followed by one number n, and draw the vertical line n with respectively 1,2 or 3 holes (spaces) at the bottom.
Examples
The Crysler Building
Input: 2479742
.
.
...
ooo
ooo
OOOOO
OOOOO
XXXXXXX
XXXXXXX
XXXXXXX
The Taj Mahal
Input: 0804023324554233204080
. .
. .
o o
o oo o
O O OOOO O O
O O OO OOOO OO O O
X X XXXXXXXXXXXX X X
X X XXXXXXXXXXXX X X
XXXXXXXXXXXXXXXXXXXXXX
The Eiffel Tower
Input: 011a2b3b5c9c9b5b3a2110
..
..
..
oo
oooo
OOOO
OOOOOO
XXX XXX
XXX XXX
XXX XXX
You can assume input is not empty and that it's well-formed.
Any language is accepted, from A+ to Z++.
This is code-golf: the shortest source code wins.
If anything in the rules is not clear, feel free to ask below in the comments.
Have fun, and capture hundred meters high structures in a few bytes!
(and don't forget to include your favourite building in your solution)
P.S.: no, you can't download/access data from the Internet, use your file name as data and all that stuff. Be fair, and use only your code-golf skills.
Seems tall 9 to me...:-? – Gabriele D'Antona – 2014-01-21T06:52:28.643
Oh, I see it: the top is defined as "c9", that means: draw a vertical line with height 9 and shave off the 3 bottom chars. That's why it seems tall 7 to you. Read the rules again and tell me if it's ok. – Gabriele D'Antona – 2014-01-21T07:04:22.410
ok, i misread your specification of the offset. – Howard – 2014-01-21T08:21:19.797