Chess AI undoing a move

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MichaelMortimer
    New Member
    • Dec 2022
    • 1

    #1

    Chess AI undoing a move

    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:
    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
    I understand that this question isn't the clearest but any help would be much appreciated
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 656

    #2
    What kind of interpretation one could have from these lines to even remotely approach the solution?

    Comment

    • markopalme
      Banned
      New Member
      • Dec 2022
      • 1

      #3
      Thanks for this interesting information!

      Comment

      Working...