On Sat, Apr 5, 2008 at 1:01 PM, Devon McCormick <[EMAIL PROTECTED]> wrote:
> There's an essay on the J-wiki about this -
> http://www.jsoftware.com/jwiki/Essays/N_Queens_Problem -  though I think it
> may have a mistake: aren't there 96 solutions if one counts all the
> rotations and reflections of the basic 12 (not 92 as stated in the essay)?

That version does not lend itself well to being expressed on one line.

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

That expression's linear representation takes 112 characters (and only
ten are redundant spaces).

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

Reply via email to