v1.0.2, my goal is to get this sub-60, which I think is actually doable.
:i)" ":s*"|"n i,{:j i\-s*"/ "2s*j*"l"n}%"*-""--"i*"*"n+++:q{"| ""o "i*"|"n}2i**q" /""__"i*);"l"
This program uses miniscule L instead of backslash since I spent like four hours today trying to find a way for GS to print ONE backslash and couldn't get it to work. It's ridiculous. Temporary patchfix, looks acceptable in TIO.
WANNA SEE A GROSS PROGRAM?
Okay, so this is obviously a disaster, so we're going to need to go through it very carefully to see why it works. Let's break this into chunks.
:i)" ":s*"|"n #Top Needle
i,{:j i\-s*"/ "2s*j*"l"n}% #Roof
"*-""--"i*"*"n+++:q #First star-dash line
{"| ""o "i*"|"n}2i** #Cabin
q #Second star-dash line
" /""__"i*);"l" #Rocket cone
So, that's mildly more digestible for my format. Work is slow today, so enjoy this overly arduous explanation.
Before we start this, I'm clarifying one thing. Input is from the header, slotted right into the stack, and our output is let on the stack, printed out when the program finishes.
:i)" ":s*"|"n #Print the top needle
:i #Set our input to i; we'll call it INDEX.
) #Increment the INDEX on the stack by 1 (not the variable)
" ":s #Put a space on the stack, and make s remember it. We'll call it SPACE.
* #Multiply this space by INPUT+1
"|" #Needle!
n #Newline
So, our stack now looks something like " ""|""/n"
, which is concatenated all together on output. Every future chunk ends with n characters, and we never back up further in the stack, so we never touch this again.
i,{:j i\-s*"/ "2s*j*"l"n}% #Print the roof
i, #Make an array of size INDEX, from 0 to i-1
{ }% #Block notation. On every element in this array, perform this
{:j }% #Remember our index as J
{ i\- }% #Subtract J from INDEX
{ s* }% #Make that many spaces
{ "/ " }% #Make a slash then a space
{ 2s*j* }% #Make 2*j spaces
{ "l" }% #lmao backslash no work
{ n}% #Add a newline
Which is for what we're looking, for every line. Done INDEX times, we have our roof!. Next!
"*-""--"i*"*"n+++:q #Print the star-line.
"*-" #First two characters.
"--" #Next two.
i* #We want a number of those double-dashes equal to INDEX.
"*" #Last asterisk
n #Newline
+++ #Concatenate that all together. We haven't done this before, but...
:q #We're remembering this entire line in Q, which saves us a TON
Next we have the o-cabin. Surprisingly the easiest part of the program.
{"| ""o "i*"|"n}2i** #Build the cabin
2i* #Double INDEX
{ } * #Perform the block 2*INDEX times
{"| " } * #First two characters
{ "o " } * #You know the drill. Combination of the two prev tactics.
{ i* } * #Make that many windows this row
{ "|" } * #East wall
{ n} * #Newline, as always.
Now comes the trickiest part of the entire program
q #Print the second star line
q #Print Q, as established above
And the bottom of the rocket.
" /""__"i*);"l" #Bottom of the rocket
" /" #So, how's your day been? Mine's been pretty slow.
"__" #Slow enough that I had time to write this whole post.
i* #Boss isn't even watching. Maybe I'll do another later.
); #Remove the last _, since we've one too many.
"l" #lmao backslashes
And that's everything! Why don't you check my work by trying it out online? 78 is the max size you can get before it starts to linebreak on TIO on my monitor, try to find yours!