View Single Post
haskell:

Kode

let b x = (case x of 0 -> "no more bottles" ; 1 -> show x ++ " bottle" ; _ -> show x ++ " bottles") ++ " of beer" ; c = (++ " on the wall") . b in forever $ mapM_ putStrLn [c x ++ ", " ++ b x ++ ". " ++ (if x == 0 then "go to the store and buy some more, " ++ c 99 ++ "." else "take one down, pass it around, " ++ c (x - 1) ++ ".") | x <- [99, 98 .. 0]]