It looks like getResults (the check for game endings) has an issue with ending
priorities. It looks like it checks for repetition and 50 move rule draws
before checkmate. It doesn't happen very often but I was trying to use pyChess
to generate some test cases and this caused some problems.
Utils/logic.py around line 40.
I made the following modifications so I could get going on my project but I
removed the LOSERSCHESS variant (Not familiar with it, sorry)
def getStatus (board):
lboard = board.board
board_clone = lboard.clone()
hasMove = False
for move in lmovegen.genAllMoves (board_clone):
board_clone.applyMove(move)
if board_clone.opIsChecked():
board_clone.popMove()
continue
board_clone.popMove()
hasMove = True
break
if not hasMove:
if lboard.isChecked():
if board.color == WHITE:
status = BLACKWON
else:
status = WHITEWON
return status, WON_MATE
else:
return DRAW, DRAW_STALEMATE
if ldraw.repetitionCount (lboard) >= 3:
return DRAW, DRAW_REPITITION
if ldraw.testFifty (lboard):
return DRAW, DRAW_50MOVES
return RUNNING, UNKNOWN_REASON
Original issue reported on code.google.com by stevemul...@gmail.com on 10 Oct 2011 at 5:57
Original issue reported on code.google.com by
stevemul...@gmail.com
on 10 Oct 2011 at 5:57