Difference between revisions of "Pseudo-Legal Move"

From Chessprogramming wiki
Jump to: navigation, search
(Created page with "'''Home * Chess * Moves * Pseudo-Legal Move''' A '''Pseudo-Legal Move''' is legal in the sense that it is consistent with the current Board Representa...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
'''[[Main Page|Home]] * [[Chess]] * [[Moves]] * Pseudo-Legal Move'''
 
'''[[Main Page|Home]] * [[Chess]] * [[Moves]] * Pseudo-Legal Move'''
  
A '''Pseudo-Legal Move''' is legal in the sense that it is consistent with the current [[Board Representation|board representation]] it is assigned to, and it must be member of all pseudo legal [[Move Generation|generated]] moves for that [[Chess Position|position]] and [[Side to move|side to move]]. For a test of a given but not already generated move, the moving [[Pieces|piece]] on its valid origin [[Squares|square]] of the [[Chessboard|board]] must have a valid target square according to its possible move [[Direction|directions]] and [[Distance|distances]]. The [[Occupancy|occupancy]] of the target square in conjunction with its piece [[Color|color]] (if any piece), or in case of distant sliding moves and double pawn pushes, the occupancy of squares between origin and target must be further considered, to determine the move is pseudo legal [[Quiet Moves|quiet]] or [[Captures|capture]] (including [[Promotions|promotion]]). [[En passant]] needs the target square trigger set from previous double push and special square tests. [[Castling]] requires appropriate [[Castling rights|castling rights]], [[Occupancy|occupancy]]- and attacking square checks.
+
A '''Pseudo-Legal Move''' is legal in the sense that it is consistent with the current [[Board Representation|board representation]] it is assigned to, and it must be member of all pseudo legal [[Move Generation|generated]] moves for that [[Chess Position|position]] and [[Side to move|side to move]]. For a test of a given but not already generated move, the moving [[Pieces|piece]] on its valid origin [[Squares|square]] of the [[Chessboard|board]] must have a valid target square according to its possible move [[Direction|directions]] and [[Distance|distances]]. The [[Occupancy|occupancy]] of the target square in conjunction with its piece [[Color|color]] (if any piece), or in case of distant sliding moves and double pawn pushes, the occupancy of squares between origin and target must be further considered, to determine the move is pseudo legal [[Quiet Moves|quiet]] or [[Captures|capture]] (including [[Promotions|promotion]]). [[En passant]] needs the target square trigger set from previous double push and special square tests. [[Castling]] requires appropriate [[Castling Rights|castling rights]], [[Occupancy|occupancy]]- and attacking square checks.
  
 
Pseudo-legal moves may still be '''illegal''' if they leave the own [[King|king]] in [[Check|check]], most often if the king was already in check before, or the moving piece was [[Pin#AbsolutePin|absolutely pinned]]. Pseudo-legal moves versus strictly [[Legal Move|legal moves]] is a matter of [[Move Generation|move generation]], and also playing [[Hash Move|hash]]- or even [[Killer Move|killer moves]] immediately without explicit move generation, but a [[Square Attacked By#LegalityTest|pseudo legality test]].
 
Pseudo-legal moves may still be '''illegal''' if they leave the own [[King|king]] in [[Check|check]], most often if the king was already in check before, or the moving piece was [[Pin#AbsolutePin|absolutely pinned]]. Pseudo-legal moves versus strictly [[Legal Move|legal moves]] is a matter of [[Move Generation|move generation]], and also playing [[Hash Move|hash]]- or even [[Killer Move|killer moves]] immediately without explicit move generation, but a [[Square Attacked By#LegalityTest|pseudo legality test]].
Line 13: Line 13:
 
=Forum Posts=
 
=Forum Posts=
 
* [https://www.stmintz.com/ccc/index.php?id=79074 Do you use illigal moves in the ply zero and 1?] by [[Leonid Liberman|Leonid]], [[CCC]], November 22, 1999
 
* [https://www.stmintz.com/ccc/index.php?id=79074 Do you use illigal moves in the ply zero and 1?] by [[Leonid Liberman|Leonid]], [[CCC]], November 22, 1999
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=73479 I just discovered a design flaw in my engine] by [[Michael Sherwin]], [[CCC]], March 27, 2020
  
 
=External Links=
 
=External Links=

Latest revision as of 21:08, 28 March 2020

Home * Chess * Moves * Pseudo-Legal Move

A Pseudo-Legal Move is legal in the sense that it is consistent with the current board representation it is assigned to, and it must be member of all pseudo legal generated moves for that position and side to move. For a test of a given but not already generated move, the moving piece on its valid origin square of the board must have a valid target square according to its possible move directions and distances. The occupancy of the target square in conjunction with its piece color (if any piece), or in case of distant sliding moves and double pawn pushes, the occupancy of squares between origin and target must be further considered, to determine the move is pseudo legal quiet or capture (including promotion). En passant needs the target square trigger set from previous double push and special square tests. Castling requires appropriate castling rights, occupancy- and attacking square checks.

Pseudo-legal moves may still be illegal if they leave the own king in check, most often if the king was already in check before, or the moving piece was absolutely pinned. Pseudo-legal moves versus strictly legal moves is a matter of move generation, and also playing hash- or even killer moves immediately without explicit move generation, but a pseudo legality test.

See also

Forum Posts

External Links

Up one Level