Skip to content

Instantly share code, notes, and snippets.

@mdunsmuir
Created May 24, 2016 22:46
Show Gist options
  • Save mdunsmuir/a59ca24d8a67f08203cc99d99e899763 to your computer and use it in GitHub Desktop.
Save mdunsmuir/a59ca24d8a67f08203cc99d99e899763 to your computer and use it in GitHub Desktop.
module Main where
import Control.Monad (when)
import System.Environment (getArgs)
import Data.List (intersperse)
fibo :: [Int]
fibo = 0 : 1 : zipWith (+) fibo (tail fibo)
hotDogsOnDay :: Int -> Int
hotDogsOnDay = (fibo !!)
seeTheHotDogsOnDay :: Int -> String
seeTheHotDogsOnDay = intersperse ' ' . flip replicate '\127789' . hotDogsOnDay
main :: IO ()
main = do
args <- getArgs
when (length args /= 1) $ error "must give how many hot dogs only"
let day = read (head args) :: Int
putStrLn $ seeTheHotDogsOnDay day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment