Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

fun challenge

Name: Anonymous 2008-05-28 20:15

Write a program that takes an integer as input and writes the integer in English.

ie:

enter integer: 23
twenty-three.

Here's my code in common lisp:

(format t "~r" (read))

Name: Anonymous 2008-05-29 3:27

>>13
*> mapM_ print . foldr (ap . map (:)) [[]] . read =<< getLine
[[1,2,3],[4,5]]
*** Exception: Prelude.read: no parse


My solution: putStr . unlines . map (show :: [Int]->String) . sequence =<< readLn

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List