[Jprogramming] Sudoku solution query

Robert Goudie robert.goudie at sail.co.nz
Mon Dec 13 17:44:54 HKT 2010


Thanks, that makes sense in the context of the dictionary definition now.

-----Original Message-----
From: programming-bounces at jsoftware.com
[mailto:programming-bounces at jsoftware.com] On Behalf Of Raul Miller
Sent: Sunday, 12 December 2010 8:02 a.m.
To: Programming forum
Subject: Re: [Jprogramming] Sudoku solution query

On Sat, Dec 11, 2010 at 12:40 AM, Robert Goudie
<robert.goudie at sail.co.nz> wrote:
> j      =. (]/. i.@#) ,{;~3#i.3
>
> generates the indicies for each box.   As a relative newcomer to J I am
> trying to figure out the relationship between the matrix created by the
> expression on the LHS of the ravel (,) and the paired box values on the
RHS
> of this expression.

Have you looked up /. in J's dictionary?
http://www.jsoftware.com/help/dictionary/d421.htm

If t=. ,{;~3#i.3
then (]/. i.@#) t
is  t ]/. i.81

So the boxes are the keys being used by ]/. and all of the
numbers corresponding to the same kind of box get
arranged in a single row of the result.

Does this help?

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



More information about the Programming mailing list