The challenge
Your program or function will accept a single string input from STDIN or a function parameter. You can assume the input will contain only alphabetic characters (a-zA-Z), spaces, and full stops. Input is case insensitive, so you should treat 'a' exactly the same as you would treat 'A'.
For each character in the string, you will output a representation of a building as per the following specification.
Each building must have a roof, designated by an underscore on the top line then a slash, space, backslash on the second line.
_
/ \
You will then have a number of floors, matching the letter number (a=1, b=2, c=3 etc.) which are represented by a wall (|) on each side and a space in the middle. The bottom floor (and only the bottom floor) should have a foundation, which is an underscore between the walls. Like this...
|_|
So for example, 'b' would look like this
_
/ \
| |
|_|
Now, we know that very tall, narrow buildings cannot stand and must get wider at the base, so no building can stand more than three storeys high without some additional support. So every three levels (no less) you should add a 'widening layer'. The widening layer consists of a slash and backslash directly above the walls of the section below it, and the section below should be two spaces wider than the section above. The extra layer does not count towards the height of the building.
Buildings should not overlap but should not have any unnecessary spaces between them, and the ground is always flat so all buildings should have their base on the same level.
For example, 'abcdefga' will look like this.
_
/ \
_ | |
_ / \ | |
_ / \ | | | |
/ \ | | | | / \
_ | | | | | | | |
_ / \ | | | | / \ | |
_ / \| | | | / \| | | | _
/ \| || |/ \| || |/ \/ \
|_||_||_||___||___||___||_____||_|
Spaces in the string input should be represented by a double space.
Full stops in the string input should be represented by rubble like this.
/\/\
Further examples
Input = Hello world.
Output =
_
/ \
| |
| |
| |
/ \
| |
| | _
| | / \
/ \ | |
| | | |
_ | | _ | |
/ \ | | / \ / \
| | / \ | | | |
| | | | | | | |
_ _ | | | | | | | | _
/ \ / \ / \ | | / \ / \ / \
| | | | | | / \ | | | | | |
| | | | | | | | | | | | | |
| | | | | | | | | | | | | |
_ / \ / \ / \ | | / \ / \ / \
/ \ | | | | | | / \ | | | | | |
| | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | |
| | _ / \ / \ / \ | | / \ / \ / \
/ \ / \ | | | | | | / \ | | | | | | _
| | | | | | | | | | | | | | | | | | / \
| | | | | | | | | | | | | | | | | | | |
| | | | / \/ \/ \ | | / \/ \/ \ | |
/ \/ \| || || | / \| || || | | |
| || || || || | | || || || |/ \
|_____||___||_______||_______||_________| |_______________||_________||___________||_______||___|/\/\
Input = lorem ipsum
_
/ \
_ | |
/ \ | |
_ | | | |
/ \ | | / \
| | _ | | | |
| | / \ / \ | |
_ | | | | | | | |
/ \ / \ | | | | / \
| | | | _ | | | | | | _
| | | | / \ / \ / \ | | / \
_ | | | | | | | | | | | | | |
/ \ / \ / \ | | | | | | / \ | |
| | | | | | | | | | | | | | | |
| | | | | | / \ / \ / \ | | / \
| | | | | | | | _ | | | | | | | |
/ \ / \ / \ | | / \ | | | | / \ | |
| | | | | | | | | | | | | | | | | |
| | | | | | / \ | | / \ / \ | | / \
| | | | | | | | | | | | | | | | | |
/ \ / \ / \ _ | | / \ | | | | / \ | |
| | | | | | / \ | | | | | | | | | | | |
| | | | | | | | / \ | | / \ / \ | | / \
| | | | | | | | | | | | | | | | | | | |
/ \/ \/ \ | | | | / \ | | | | / \ | |
| || || |/ \ | | | | | | | | | | | |
| || || || |/ \ | |/ \/ \| |/ \
|_______||_________||___________||___||_________| |_____||___________||_____________||_____________||_________|
Input = a.a.a.x.x.x.a.a.a
_ _ _
/ \ / \ / \
| | | | | |
| | | | | |
| | | | | |
/ \ / \ / \
| | | | | |
| | | | | |
| | | | | |
/ \ / \ / \
| | | | | |
| | | | | |
| | | | | |
/ \ / \ / \
| | | | | |
| | | | | |
| | | | | |
/ \ / \ / \
| | | | | |
| | | | | |
| | | | | |
/ \ / \ / \
| | | | | |
| | | | | |
| | | | | |
/ \ / \ / \
| | | | | |
| | | | | |
| | | | | |
/ \ / \ / \
_ _ _ | | | | | | _ _ _
/ \ / \ / \ | | | | | | / \ / \ / \
|_|/\/\|_|/\/\|_|/\/\|_______________|/\/\|_______________|/\/\|_______________|/\/\|_|/\/\|_|/\/\|_|
Rules
- Of course this is code golf, lowest score in bytes wins
- Standard loophole rules apply
- Any number of additional blank lines before or after the output are allowed
- You can choose to output the entire result in one string or offer the output as an array where each element represents one line of output, or send to STDOUT
Note
This is my first post to PPCG, so please go easy on me. It's been through the sandbox. Any negative points or possible improvements please post as a comment and I'll do what I can
[a,z]
and[A,Z]
to[1,26]
seems like a pointless requirement. It would be much better to just use a list integers as input (having0
be the input for rubble). Also, posting your challenge after it's been in the Sandbox for only 21 hours, without waiting to get any votes or feedback from more than one user, does not count as it having "been through the sandbox". It's recommended to leave challenges in the Sandbox for 48-72 hours at the minimum, to give people plenty of time to review them. \$\endgroup\$[a,z]
,[1.26]
parts the Mego mentioned. Having it optional is often the best (unless it's a key part of the challenge (it's not here). \$\endgroup\$