Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bit boards in Shogi?

Author: Robert Hyatt

Date: 11:11:07 08/29/98

Go up one level in this thread


On August 29, 1998 at 00:30:44, David Eppstein wrote:

>On August 28, 1998 at 18:06:49, Robert Hyatt wrote:
>>On August 28, 1998 at 16:50:31, David Eppstein wrote:
>>>I think this power of two thing is a red herring. Even for an 8x8 board you
>>>have to mask so your pieces don't think they can wrap around from one side
>>>of the board to the other.
>>You really don't have to do this...  IE I have *no* such masks in Crafty.
>
>Oh no?
>What is this:
>
>(line 167 of movgen.c)
>    pcapturesr=And(Shiftr(And(WhitePawns,mask_right_edge),9),target);
>
>If it's not a mask, why do you call it mask_right_edge?

I hate to follow up on myself, but the above is not exactly the case you
mentioned above:

>>>I think this power of two thing is a red herring. Even for an 8x8 board you
>>>have to mask so your pieces don't think they can wrap around from one side
>>>of the board to the other.

When I read that, it implies (to me) that I need a *bigger* mask to handle this
"wraparound", where bigger means more bits than the basic bitboard.  That is
completely wrong.

In the above example you gave, I generate *all* the pawn moves in one step,
which is faster than generating moves for each pawn separately.  But in doing
so, I do have to prevent "wrap" when I shift the pawns diagonally forward for
capture moves, by simply eliminating pawns on the h-file before shifting diag-
onally to the right, and eliminating pawns on the a-file before shifting diag-
onally to the left.  But notice both masks are 64 bit masks, and that they are
only used in pawn captures, not normal pawn moves, nor in moves by any other
piece of any type...

That was my point... the "red herring" caught my attention first, because I
don't have *any* masks of any kind that are longer than 64 bits...  in
move generation, evaluation, or anywhere else...



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.