Re: A Su Doku solver
- To: mathgroup at smc.vnet.net
- Subject: [mg60659] Re: A Su Doku solver
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Fri, 23 Sep 2005 04:20:08 -0400 (EDT)
- Organization: The University of Western Australia
- References: <200509191007.GAA25694@smc.vnet.net> <dgtutc$6sb$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <dgtutc$6sb$1 at smc.vnet.net>,
"Valeri Astanoff" <astanoff at yahoo.fr> wrote:
> If I'd read all that has been posted about SuDoku
> in this group, I'd never posted my poor solution
> ( poor but very short indeed ! ).
>
> By the way I have to thank Fred Simons to point
> the fact that :
>
> m[[{1,2,3}]] [[All,{1,2,3}]]
>
> is just the same as :
>
> m[[{1,2,3},{1,2,3}]]
Another point: your case by case analysis in your original posting can
be generated using Outer. Assuming that m is a 3 x 3 matrix:
li = Partition[Range[9], 3, 3]
Outer[{First[#1] <= i <= Last[#1] &&
First[#2] <= j <= Last[#2],
m[[##]]} &, li, li, 1]]
Cheers,
Paul
_______________________________________________________________________
Paul Abbott Phone: 61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
AUSTRALIA http://physics.uwa.edu.au/~paul
- References:
- A Su Doku solver
- From: "Valeri Astanoff" <astanoff@yahoo.fr>
- A Su Doku solver