> 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 ?
If BLACK is 0 and WHITE is 1 is easy to write code like
procedure DoSomething(p: boardoffset; color: boardcolor);
begin
othercolor := 1-color;
...
end;
since one rarely want to deal with the colors explicetely. But this is
of course a rather minor point. It does not matter for the
performance because you only make this transformation once in
every procedure.
Magnus Persson