Skip to main content
7 of 7
Commonmark migration

Haskell 155 153 139 131 Bytes

I found a slightly different approach that turned out to be shorter than my original method. My original attempt is preserved below. As with before, golfing tips are appreciated.

m n=unlines.dropWhile(==" ").z[" "," /","/"].foldr1 z$map t[1..n] t n|odd n=["","\\","__\\"] t _=["____"," /","/"] z=zipWith(++) 

Thanks to Nimi for the golfing tips.


Previous Attempt 197 179 Bytes

t n=putStr.unlines.dropWhile(all(==' ')).z(flip(++))(if odd n then["","\\","__\\"]else repeat"").z(++)[" "," /","/"].map(take(4*div n 2).cycle)$["____","\\ /","__\\/"] z=zipWith 
ankh-morpork
  • 1.5k
  • 1
  • 12
  • 15