„ /SõD‚„\ ‚D4δ∍D)T•4a֙镓| 0\
1/“ÅвJrI33÷IĀ+©è‡∊'_1•uтÄ•22в®è‚ǝ
When I started I thought I would be able to make this pretty short with the approach I had in mind, but it had some annoying edge cases to fix.. Can definitely be golfed, though. Will take another look later on.
Try it online or verify some more test cases.
Explanation:
„ / # Push string " /"
S # Convert it to a list of characters: [" ","/"]
õD‚ # Push an empty string "", duplicate it, and pair them together: ["",""]
„\ # Push string "\ "
 # Bifurcate it (shorter for duplicate and reverse copy)
‚ # Pair them together: ["\ ","\ "]
D # Duplicate it
4δ∍ # Extend both inner strings to size 4: ["\ \ ","\ \ "]
D # Duplicate it
) # Wrap all lists on the stack into a list:
# [[" ","/"],["",""],["\ ","\ "],["\ \ ","\ \ "],["\ \ ","\ \ "]]
T # Push 10
•4aÖ™é• # Push compressed integer 17523821317
“| 0\
1/“ # Push string "| 0\\n1/"
Åв # Convert the integer to custom base-"| 0\\n1/"
J # And join these characters together to a single string:
# " /| 1\n
# | |\0"
r # Reverse the items on the stack (list, 10, string to string, 10, list)
I33÷ # Push the input, and integer-divide it by 33
IĀ # Push the input again, and truthy it (0 if 0; else 1)
+ # And add them together (0→0; 1..32→1; 33..65→2; 66..98→3; 98..100→4)
© # Store it in variable `®` (without popping)
è # And index it into the list we created at the start
‡ # Then transliterate the ["1","0"] of 10 to the strings in this pair
∊ # Now vertically mirror the entire string
# (i.e. " /| \n
# | |\/" becomes:
# " /| \n
# | |\/\n
# | |/\\n
# \| "
•/Tδ• # Push compressed integer 7095187
₂в # Converted to base-26 as list: [15,13,17,21,21]
® # Push variable `®` again
è # Index it into this list
1 ‚ # Pair it with a leading 1
'_ ǝ '# And insert a "_" at those 0-based positions inside the string
# (after which the result is output implicitly)
See this 05AB1E tips of mine (section How to compress large integers? and How to compress integer lists?) to understand why •4aÖ™é•
is 17523821317
; •/Tδ•
is 7095187
, and •/Tδ•₂в
is [15,13,17,21,21]
.
You should have based the volume on 0 - 10 so that someone could answer with "mine goes to 11" – Shaun Bebbers – 2019-11-14T13:35:49.317