Author: Robert Hyatt
Date: 08:47:54 08/22/04
Go up one level in this thread
On August 22, 2004 at 03:10:32, Russell Reagan wrote: >On August 20, 2004 at 14:27:22, Tord Romstad wrote: > >>>Without bitboards, the code looks roughly like this: >>> >>>if(pawn_race[(square of white pawn)-(square of black pawn)]) >>> pawn can't run > >Did you mean to take the difference of two pawn squares? Bob's code detected >whether a king could stop a pawn. Your code looks like it detects which passed >pawn (white's or black's) promotes first. > >I'm also curious how yours works (regardless of what you meant), since it uses >square differences (the 0x88 trick I assume?). Sometimes a pawn can move two >squares. How do you account for that? > >Offset of 1 - White can promote >[D]8/8/8/8/8/8/3Pk3/8 w - - 0 1 > >Offset of 1 - White can not promote >[D]8/8/8/8/8/3Pk3/8/8 w - - 0 1 > >So you can't depend on the pawn-king offset, can you? That is why I use "square of the pawn" rather than "square of the king". I account for the double-move in the mask for a pawn on that square, and don't have to treat it separately.
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.