N Queens by flagitious

N=eval *$<
def r*a
puts a*' 'if N==k=a.size
b=*0...N
a.map{|i|b-=[i,i-k,i-~k-=1]}
b.map{|*j|r *a+j}end
r

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

download

return to the top page