diff --git a/chess.py b/chess.py index 0fd09a6..ec1b186 100644 --- a/chess.py +++ b/chess.py @@ -199,7 +199,7 @@ class Game: """Shorten moves and history stacks if move is made while past game state is loaded into memory. Essentialy overrides future game states.""" - self.moves = self.moves[:self.index+1] + self.moves = self.moves[:self.index] self.history = self.history[:self.index+1] def timetravel(self, i): @@ -528,4 +528,11 @@ class Game: return True - +game = Game() +while True: + i = input(">> ") + game.AN_move(i) + if i =="prev": + game.prev() + print(game) + print(game.index, len(game.history), len(game.moves))