Author: David Dory
Date: 12:55:05 02/06/04
Go up one level in this thread
On February 06, 2004 at 12:19:47, Michael Yee wrote:
>Hi,
>
>I searched the web, but had no luck finding a description of this technique.
>Would anyone mind giving a quick explanation?
>
>Thanks,
>Michael
Hi Michael,
Same phrase, but different meanings. To me, "mailbox" is _always_ done with a
two dimensional array, never a one like Mr. Roger's uses.
So the sqr's on the board really look like the back of the post office boxes you
might have your mail sent to.
This is a part of the move generation of my mailbox program:
if(piece == WR) {
int trow = row; int tcol = col;
//Rook's 4 rays - this is ray #1 - 12 o'clock
while(board[++trow][col] < 1 && trow < 9) {
AllMoves[ply][movenum][0] = row * 10 + col;
AllMoves[ply][movenum++][1] = trow * 10 + col;
if(board[trow][col] < 0) break; //ray stopped if it's a capture move
}
trow = row; tcol = col;
while(board[row][++tcol] < 1 && tcol < 9) { //rook ray #2 - to 3 o'clock
AllMoves[ply][movenum][0] = row * 10 + col;
AllMoves[ply][movenum++][1] = row * 10 + tcol;
if(board[row][tcol] < 0) break;
}
... etc.
}
As you might guess, my board is 10 X 10, with a unique integer value around the
unused squares. For convenience, my board's first row is "1" so it runs from a1
being 11, to h8 being 88.
While you might use attack tables, etc., this doesn't have anything to do with
the "mailbox" part of the program, as I use and understand it.
Since it uses a two dimenional array, it is slower than Roger's single row type
of board representation, which makes a useful improvement. IMO.
Regards,
David
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.