I have created a chess program but am stuck on one specific part. If I am playing against an AI but want to undo a move, I am unable to do so. Instead of undoing my previous move, the AI just picks another move. Here is the code:
I understand that this question isn't the clearest but any help would be much appreciated
Code:
if e.key == p.K_z:
GS.UndoMove() #Undo the last move
MoveMade = True
Animate = False #Don't animate the pieces returning to their previous positions
GameOver = False #No player has won yet
if AIThinking:
MoveFinderProcess.terminate() #Stops the AI about thinking about potential moves as we don't know what move will be played next
AIThinking = False
MoveUndone = True
Comment