Discussion of chess software programming and technical issues.
Moderator: Ras
jshriver
Posts: 1360 Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA
Post
by jshriver » Sat Dec 31, 2022 2:57 pm
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
jshriver
Posts: 1360 Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA
Post
by jshriver » Sat Dec 31, 2022 4:24 pm
Can ignore I misunderstood how those flags worked. board.turn is what I needed instead. Mods feel free to delete this thread.