MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A Su Doku solver


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


  • Prev by Date: Re: Vectorization
  • Next by Date: Re: Re: Mathematica 5.0 and Excel
  • Previous by thread: Re: A Su Doku solver
  • Next by thread: Re: another Bug in Reduce ?