Skip to content

Instantly share code, notes, and snippets.

@alterakey
Created April 8, 2015 17:59
Show Gist options
  • Save alterakey/e03372f0f37baa1bc944 to your computer and use it in GitHub Desktop.
Save alterakey/e03372f0f37baa1bc944 to your computer and use it in GitHub Desktop.
egg launcher exercise in haskell
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as I
egg x pad y = T.take x $ T.justifyLeft x pad y
repetitive_egg x pad y = egg x pad $ T.replicate (1 + (div x $ T.length y)) y
main = I.putStrLn . repetitive_egg 20 '\x90' $ T.pack "\x11\x22\x33\x44"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment