Invert FizzBuzz by nn

System.in.eachLine{l=it.replaceAll(/\w+ ?/){it=~/zB/?5:it<'F'?2:3}
i=0
for(s='';i<182&&!(j=0xFCA9653>>4*s.indexOf(l)&15);s+=i%5?a:a+2)a=++i%3?'':3
println l-32?j?j+' '+i:'':'9 10'}

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

download

return to the top page