N Queens by ksk

def f _,a=_,i=9
puts _*" "if _[-($$%15^9).times{|x|b=x+i,x-i,x
f _+[x],a+b,i+1if a-b==a}]end
f$*

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

download

return to the top page