Author: Albert Silver
Date: 04:39:17 12/17/99
Go up one level in this thread
On December 16, 1999 at 13:42:46, Tom Kerrigan wrote:
>On December 16, 1999 at 13:19:04, Albert Silver wrote:
>>That's true but I would have imagined it would be relatively easy to program. As
>>a player I basically treat it as two possibilities:
>>- The pawn is forward two squares.
>>- The pawn moved one square and I captured it.
>>Is programming it any different?
>
>It depends on what you consider "easy." You have to keep track of each move
>where a pawn moves two squares, and which square it moved over. Then you have to
>check to see if a pawn is attacking that square, because the normal pawn capture
>code doesn't work because there's not a piece on that square. Then you have to
>have special code in makemove() to capture the pawn that moved two squares. And
>more special code in takeback() to put the captured pawn back. So it's not
>trivial...
>-Tom
I'm a non-programmer (though I plan to remedy that to a degree), but I would
have thought you could apply what I said above into enpassant programming.
Granted it all pends on when an en passant circumstance occurs, but then the
possibilities are identical:
1) The pawn moved two squares. True you have to control the square the pawn
passed over, but this is no different than what is done when a bishop, rook, or
queen move more than one square. Once done just treat the position as if the
pawn was just there (no en passant captures, the pawn was always there)
2) Move the pawn only one square ahead and force its capture (no wishy washiness
here). Calculate this possibility as a normal capture, though forced, and weigh
in the eval at the end to choose between 1) and 2).
Albert Silver
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.