Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Help me correct some Game Courier logs[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Wed, Dec 27, 2017 04:53 PM UTC:

Greg,

I fixed Game Courier to auto-correct that log. Although it worked well when a player made his move, it got confused when someone viewed a finished game. The code in that circumstance was not complex enough to tell who had won. To tell who was playing when the won command was used, I changed the code to

$GLOBALS["winner"] = (($movenum & 1) ^ ($side != $first)) ? $player : $opponent;

This first checks whether the move number was odd. It should be odd for the first player, and it should be even for the second. It then xors this with the inequality of the current side and the first side to move. This inequality should be true for the second player and false for the second. So, it determines the winner like this:

  Movenum is odd Movenum is even
side is first Player Opponent
side is not first Opponent Player