summaryrefslogtreecommitdiff
path: root/95-99/95.hs
blob: 4a6ff496727e9608dd96c612d2365b02d45079e6 (plain) (blame)
1
2
3
4
5
fullWords :: Int -> String

fullWords x = if x < 10 then s else fullWords (x `quot` 10) ++ "-" ++ s
    where s = ["zero", "one", "two", "three", "four",
              "five", "six", "seven", "eight", "nine"]!!(x `mod` 10)