[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: computer-go: Sharing Go modules



On Wed, May 16, 2001 at 08:33:12AM -0700, Anders Kierulf wrote:
> > The coordinate coding method that I use is X,Y converts to X+Y*20. The
> > arrays are all 421 long where all te points at 0,Y and X,0 contain special
> > values to make it easy to detect the edge of the board. This is a
> convenient
> > coding since it's still fairly easy to see which coordinates they
> represent
> > (for example: 63 is 3,3 and 356 is 16,17). However I do realise that every
> > Go programmmer has their own idea of how this should be done and that
> > there's little chance that I can convince everyone in the world to use
> this
> > scheme (that would be nice though <grin>) instead of using separate X and
> Y
> > coordinates.
> 
> This is a good scheme. It's the same scheme SmartGo uses, so at least two Go
> programs have independently reached exactly the same solution. Please go
> ahead and convince the rest of the world. :-)

I agree it's a good scheme. It's the same one that NNGS uses.
Being able to address the neighbours of point pos as
pos-Vdiff, pos-1, pos+1, and pos+Vdiff is quite a bit more convenient
than dealing with (-1,0), (0,-1), (0,1), (1,0) vectors.
Is it similarly standard to use 0 for EMPTY, 1 for BLACK, 2 for WHITE,
and 3 for EDGE ?

regards,

%!PS                       %  -John Tromp (http://www.cwi.nl/~tromp/)
42 42 scale 7 9 translate .07 setlinewidth .5 setgray/c{arc clip fill
setgray}def 1 0 0 42 1 0 c 0 1 1{0 3 3 90 270 arc 0 0 6 0 -3 3 90 270
arcn 270 90 c -2 2 4{-6 moveto 0 12 rlineto}for -5 2 5{-3 exch moveto
9 0 rlineto}for stroke 0 0 3 1 1 0 c 180 rotate initclip}for showpage