Skip to content

Instantly share code, notes, and snippets.

@nabe256
Created March 17, 2013 22:42
Show Gist options
  • Select an option

  • Save nabe256/5183954 to your computer and use it in GitHub Desktop.

Select an option

Save nabe256/5183954 to your computer and use it in GitHub Desktop.
NSEG #37 Code Golf
import System.Environment
import Data.Char
knum = "〇一二三四五六七八九"
kketa = "十百千"
main = do
args <- getArgs
if length args == 0
then putStrLn "input: number"
else translate $ args !! 0
translate = putStrLn . reverse . map (\x -> knum!!(digitToInt x)) . reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment