Japanese numeral for Ruby kaigi by tal

#!ruby -n
l=d=0
scan(/.../){k="i%*'7rn?[lYh".index(($&.hash%?x).chr);l=k<4?(d+=(l>0?l:1)*10**k;0):k-2}
p d+l

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

download

return to the top page