As in LibEGO, if you define the off-board points to be both black AND
white, finding captures requires fewer branches.
Peter Drake
http://www.lclark.edu/~drake/
On Jul 13, 2009, at 8:48 AM, David Fotland wrote:
I use one dimensional arrays for speed (to avoid a multiply by 21).
Old Many Faces code uses arrays of 363 (361 points, pass, and null-
point).
The smallest possible arrays were required to run under 500 KB total
memory.
I avoided edge checks by having a set of small offset arrays (with
2, 3, or
4 offsets), chosen by the board.
My MCTS code uses single dimension arrays with size suggested by
Mark Boon,
from Goliath, 20 * 21 + 2. This is enough to have points off the
edge on
all sides and diagonals.
David
-----Original Message-----
From: computer-go-boun...@computer-go.org [mailto:computer-go-
boun...@computer-go.org] On Behalf Of Carter Cheng
Sent: Monday, July 13, 2009 8:36 AM
To: computer-go@computer-go.org
Subject: [computer-go] Basic question concerning the edges of the
board
Hi,
I have again been considering trying my hand at implementing a
simple go
program. The question I have pertains to checking for the edge of the
board
in capture situations and so on. For a modern CPU (given what limited
information I have on this) the extra branches might result in
pipeline
stalls if I am constantly checking if values are in range. Is it
best to
extend the size of the board to say 21x21 to somehow avoid these
sorts of
checks? Or are the relative cost of these branches negligible in the
scheme
of things?
Thanks in advance,
Carter.
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/