79282462

Date: 2024-12-15 13:52:51
Score: 1
Natty:
Report link

I don't know why, but the push will affect the board. make a copy of the board, and no problem anymore.

import chess
import copy

board = chess.Board()
starting_position=board.fen()
new_board= copy.copy(board)

for move in board.legal_moves:
    print(starting_position)
    board=copy.copy(new_board)
    board.set_fen(starting_position)
    print(move)
    board.push(move)
    print(f' board pushed move {board.fen()}')
    print()

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user28471654