Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

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


  • 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 ?