Japanese numeral for Ruby kaigi by yshl

100{(%stdin)(r)file 99 string readline{0 0 1 3 4 index length{3 index exch 2
getinterval{}forall exch 12 mod 9 ne{19 mod(\10a\6\4\3\11a\2aaaaaa\1\5a\7)exch
get add}{dup 3 mod 0 eq{pop 10}{5 mod 0 eq{100}{1000}ifelse}ifelse exch dup 0
eq{1 add}if mul add 0}ifelse}for add =}if}repeat

Note that non-ascii characters in the above source code will be escaped (such as \x9f).


return to the top page