Possible python-chess bug

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
jshriver
Posts: 1360
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Possible python-chess bug

Post by jshriver »

When setting a board to a fen position it appears it doesn't properly set the proper side to move. There also seems to be no way to really force side to move either. Here is an example:

Code: Select all

import chess

seedfen = "2kr3r/1pp2ppp/p2bpn2/4n1q1/P2N4/1PP1B1PP/5PB1/R2R2K1 w - -"
board = chess.Board(seedfen)
print("White value: ", chess.WHITE)
print("Black value: ", chess.BLACK)

seedfen = "2kr3r/1pp2ppp/p2bpn2/4n1q1/P2N4/1PP1B1PP/5PB1/R2R2K1 b - -"
board = chess.Board(seedfen)
print("White value: ", chess.WHITE)
print("Black value: ", chess.BLACK)

display(board)
Output

Code: Select all

White value:  True
Black value:  False
White value:  True
Black value:  False
User avatar
jshriver
Posts: 1360
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Possible python-chess bug

Post by jshriver »

Can ignore I misunderstood how those flags worked. board.turn is what I needed instead. Mods feel free to delete this thread.