Skip to main content
1 of 2
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394

#05AB1E, 37 bytes

≠iðð'_I2÷4*×J}„ /„\ ‚I>∍J'/…__\‚I>∍J» 

Try it online or verify the first 10 outputs.

Explanation:

≠i } # If the (implicit) input is NOT 1: # i.e. 1 → 0 (falsey) # i.e. 5 → 1 (truthy) ðð # Push two spaces " " '_ '# Push string "_" I # Push the input 2÷ # Integer-divide it by 2 # i.e. 5 → 2 4* # And then multiply it by 4 # i.e. 2 → 8 × # Repeat the "_" that many times # i.e. "_" and 8 → "________" J # Join everything on the stack together to a single string # i.e. " ________" „ / # Push string " /" „\ # Push string "\ " ‚ # Pair them together: [" /","\ "] I> # Push the input+1 ∍ # Extend the list to that size # i.e. [" /","\ "] and 2 → [" /","\ "] # i.e. [" /","\ "] and 6 → [" /","\ "," /","\ "," /","\ "] J # Join the list together to a single string # i.e. [" /","\ "] → " /\ " # i.e. [" /","\ "," /","\ "," /","\ "] → " /\ /\ /\ " '/ '# Push string "/" …__\ # Push string "__\" ‚ # Pair them together: ["/","__\"] I> # Push the input+1 ∍ # Extend the list to that size # i.e. ["/","__\"] and 2 → ["/","__\"] # i.e. ["/","__\"] and 6 → ["/","__\","/","__\","/","__\"] J # Join the list together to a single string # i.e. ["/","__\"] → "/__\" # i.e. ["/","__\","/","__\","/","__\"] → "/__\/__\/__\" » # Join the entire stack with a newline delimiter # i.e. " /\ " and "/__\" → " /\ \n/__\" # i.e. " ________", " /\ /\ /\ " and "/__\/__\/__\" # → " ________\n /\ /\ /\ \n/__\/__\/__\" # (and output the result implicitly) 
Kevin Cruijssen
  • 136.3k
  • 14
  • 155
  • 394