刚下载了 Python-Chess 模块,想测试一下;每当我使用board.is_checkmate、board.is_stalemate、和 print 语句检查板状态时,它总是返回 true board.is_check。board.is_en_passant我在 macOS 11.3 上使用 VSCode。Python 版本是 3.8.2。
import chess
board = chess.Board()
if board.is_checkmate:
print("game over")