Counting adventure by murky-satyr

s=' six seven eight nine  ten eleven twel'
f=" four fif${s-'t'}f"
"$System.in".toLong().times{i->d=i%10
n={o,p->c="$o$p thir$f".split()
i>18?i>98?'one hundred':"twen thir${f-'u'}".split()[-~i/10-2as int]+(d<9|o>'g'?'ty':'tie')+(d<9?'-'+c[d]:''):c[i]+(i>11?'teen':'')}
println"The ${n'first second third',f-'e '}${d>2|2<i&i<13?'th':''} positive integer is ${n'one two three'," four five${s}ve"}."}

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

download

return to the top page