Japanese numeral for Ruby kaigi by ksk

#!ruby -n
d=0
gsub(/...|$/){$y=" \xa3\xc7\xac\x7f\xcfy\xa6w\xcd".index(x=$&.hash%?\xef)||!d+=($y||x%2)*10**x%=5}
p d

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

download

return to the top page