Consider this layout for a 2x2 go board

????
?++?
?++?
????

If you copy that row by row, into a 1d array, you get
?????++??++?????

That can be reduced to
????++?++????


Sent from my iPhone

On Jul 13, 2009, at 1:27 PM, Carter Cheng <[email protected]> wrote:


Thanks all for the replies. I am not sure I quite get the 20x21+2 idea but I will take a look back in the archives. Does anyone remember roughly when it was posted to the list?

Thanks again,

Carter.

--- On Mon, 7/13/09, Peter Drake <[email protected]> wrote:

From: Peter Drake <[email protected]>
Subject: Re: [computer-go] Basic question concerning the edges of the board
To: "computer-go" <[email protected]>
Date: Monday, July 13, 2009, 9:08 AM
As in LibEGO, if you define the
off-board points to be both black AND white, finding
captures requires fewer branches.
Peter Drakehttp://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:
[email protected] [mailto:computer-go-
[email protected]]
On Behalf Of Carter Cheng
Sent: Monday, July 13,
2009 8:36 AM
To: [email protected]
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
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/

_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/


-----Inline Attachment Follows-----

_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/



_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/
_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to