Japanese numeral for Ruby kaigi by nn

b=[]
i=0
System.in.eachByte{it-10&&[i++%3?(u+=it):(u=0),i%3||b<<-u%23%18]||[q=v=0,b.each{p=[4,8,2,0,6,0,0,3,100,9,1e3,0,10,7,0,0,1,5][it];p>9&&(v+=q?q*p:p);q=p>9?0:p},println(v+q),i=0,b=[]]}

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

download

return to the top page