Skip to main content
Commonmark migration
Source Link

#Haskell 155 153 139 131 Bytes

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

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 

#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 

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 
edited body
Source Link
ankh-morpork
  • 1.5k
  • 1
  • 12
  • 15

#Haskell 155 153 139 132131 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 

#Haskell 155 153 139 132 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 

#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 
139 -> 132; Returns string instead of printing
Source Link
ankh-morpork
  • 1.5k
  • 1
  • 12
  • 15

#Haskell 155 153 139139 132 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=putStr.unlinesn=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 

#Haskell 155 153 139 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=putStr.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 

#Haskell 155 153 139 132 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 
153 -> 139
Source Link
ankh-morpork
  • 1.5k
  • 1
  • 12
  • 15
Loading
putStrLn -> putStr
Source Link
ankh-morpork
  • 1.5k
  • 1
  • 12
  • 15
Loading
Golfed first attempt. Found better approach.
Source Link
ankh-morpork
  • 1.5k
  • 1
  • 12
  • 15
Loading
Source Link
ankh-morpork
  • 1.5k
  • 1
  • 12
  • 15
Loading