> I always used a 1-dimensional 25x25 = 625 integer array with 0 for > black 1 for white 2 for empty and 3 for border (everything else). > > This way I can have a 21x21 board with 2 rows of border cells > surrounding it.
David Fotland, on the other hand, seems to use a 19x19 grid, and detect off-board separately. (?) This is the way I've also always done it. I get round the speed issues of off-board detection because I have a global singleton called APD (Adjacent Point Data). Its constructor caches lots of results. E.g. it has functions to turn a 0..N coord into x and y coords, functions to rotate points, functions to return the coord a certain distance away (e.g. ikken to the North, keima to the South-East). That latter function returns a special value when off-board. APD also has functions for looping (e.g. through all the adjacents, or all the diagonals, or even all the ogeima; automatically skipping over off-board), for measuring distance to nearest edge or nearest corner, and for point "type" (corner, edge, centre). But, still, I wonder if the N+1 x N+1 design is quicker. Darren _______________________________________________ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/