You don't want to pay money for the expensive architectural program, so you decide to roll your own. You decide to use ASCII to design your buildings. Your program will take in a single string formatted in a specific way, and the program will output the building.
Input consists of a single line of characters. It can be assumed to only contain the letters
a-j, the numbers
1-9, and the symbols
For each letter
a-j, the program will output a vertical line as follows. We will call this a column.
. .. ... **** ***** ****** ------- -------- +++++++++ ++++++++++ abcdefghij
For instance, the input
abcdefgfedefghgfedc would output:
. * *** *** ***** ***** ******* --------------- ----------------- ++++++++++++++++++ +++++++++++++++++++
A letter may be prefixed with a positive integer
n, which will add
n whitespace characters below the column. We will call this an offset. For instance, using
S to notate a whitespace, the input
3b2b3b would output:
+ + +++ S+S SSS SSS
A letter may also be prefixed with a negative integer
-m, which will remove the bottom
m non-whitespace characters of the column (not replace them with whitespace, remove them entirely). We will call this a slice. For instance, the input
-1j-2j-3j-4j-5j-6j-7j-8j would output:
. .. ... *... **... ***... -***... --***... +--***..
An offset and a slice can be applied to the same line, but the offset must go first. In other words, the letter may be prefixed with
n is the size of the offset, and
m is the size of the slice. For instance, using
S to notate a whitespace, the input '2-4j' would output:
. . . * * * S S
+ operator used between two columns indicates that they should be stacked on top of each other in the same column instead of in seperate columns. For instance, the input `2-4ja' outputs:
. . . * * * S S+
Whereas the input
+ . . . * * * S S
Here is a sample input:
And the resultant output:
* - . - . . +. . * * +* * * * **** ******** -------- -------- - +++++++++ ++ +++++++++++++
Looks like an old destroyed castle tower of some sort.
Here is another sample input:
And the resultant output:
****** +++ ******+.*++ ---++.+ *** -+-+++..++** -+--+++.+++* --++++.+..* +++++.+** +++****.****** - +++*****.**.. -- + ***....+..-- ...+.....-- --.........-- ---...... --
(It was supposed to be Mario but didn't turn out very good...)
If the specification still isn't clear, I have a non-golfed implementation written in Python 2.7. You can run it and experiment to get a feel for how the specification works. You may also choose to laugh at my programming skills.
This is code-golf, so shortest entry wins. Ask questions in comments if unclear.