Skip to content

Instantly share code, notes, and snippets.

@jkramer
Created July 25, 2010 13:55
Show Gist options
  • Save jkramer/489580 to your computer and use it in GitHub Desktop.
Save jkramer/489580 to your computer and use it in GitHub Desktop.
--
-- This was supposed to be my solution for the Code Golf at Stack Overflow:
-- http://stackoverflow.com/questions/3324301/code-golf-digital-clock
--
-- However, when I finished, that thread was closed and I couldn't post it
-- anymore. :(
--
main = getLine >>= \ n -> mapM_ (\ s -> putStrLn $ d s n) l
l = [[8,0,8,8,0,8,8,8,8,8,0],[17,4,24,24,25,9,9,16,25,25,12],[25,4,9,24,16,24,25,16,25,24,12]]
i ':' = 10
i x = read $ return x
c = (!!) " |_."
t x = map (c . flip mod 4 . div x) [1,4,16]
d xs = concatMap (t . (!!) xs . i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment