Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.1

Bug #13133 stalemate
Submitted: 2008-02-16 15:52 UTC
From: dapetras Assigned:
Status: Open Package: Games_Chess (version 1.0.1)
PHP Version: 5.2.5 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2008-02-16 15:52 UTC] dapetras (Dan Petras)
Description: ------------ In the process of mating my opponent with a Bishop and Knight when the game was suddenly and incorrectly declared a stalemate. Check facebook game # 537921 I have no idea what PHP package version as I am a facebook end user and am having a problem.

Comments

 [2016-12-29 17:58 UTC] jkgarner (James Garner)
I am not sure hat caused the bug listed, as I was unable to view the game on facebook listed. However, in looking at the code, I saw an obvious logical error that will cause the game to declare a draw too soon. code in package: /** * Determine whether any pawn move or capture has occurred in the past 50 moves * @return boolean */ function in50MoveDraw() { return $this->_halfMoves >= 50; } IN relation to the 50 move rule, a player must move 50 times with no capture and no pawn movement. This is tracked nicely with the _halfMove variable, which is incremented whenever a player makes any move, eitther side. This is also called plys in chess programing circles. The ply count of 35 or halfMove count of 50 cooresponds with a move count of 25. This code will throw the 50 mvoe rule draw when a player gets to 25 moves, far too soon. The check should be to 100 or greater.