Gaussian Prime by yvl

puts (r=-23..23).map{|b|r.map{|a|(2..n=(m=2.-a*a*b*b<=>1)<3?a*a+b*b:(a+b).abs).one?{|i|n%i<1}&&m==n%4?"[]":"  "}*""}

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

download

return top