On Sun, Apr 6, 2008 at 11:39 AM, Devon McCormick <[EMAIL PROTECTED]> wrote:
> Wait, it _is_ online:
> http://www.vector.org.uk/archive/v103/selfridge103_94.htm (Ralph's one-liner
> solution to the N-Queens problem).

Interesting.

A J one-liner (transcribed, almost literally, from that explicit
solution in the J
wiki) was significantly shorter.

Repeated here (but probably line wrapped by email):

queens=:(((~.@,[EMAIL PROTECTED]"1[:,.]+"1
_(i:1)*/~(-i.)@{:@$)((#~+/"1)~,.,@[#*/@[EMAIL PROTECTED]@,@])])^:([EMAIL 
PROTECTED]))@(i.@,*)

   queens 4
1 3 0 2
2 0 3 1

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to