thomasahle / sunfish

Sunfish: a Python Chess Engine in 111 lines of code
https://www.chessprogramming.org/Sunfish
Other
2.95k stars 543 forks source link

Fix parsing position uci command #73

Closed bobtie closed 3 years ago

bobtie commented 3 years ago

Fixing uci.py to correctly handle a position command like the following one:

position fen rnbqkbnr/ppp2ppp/8/3pp3/4P3/5P2/PPPP2PP/RNBQKBNR w KQkq - 0 3 moves c2c3

namely when both fen string and move list are specified as allowed by the syntax spefied in UCI protocol:

position [fen | startpos ] moves ....

thomasahle commented 3 years ago

Thank you! This is a good fix. Can you run commit through autopep8 so we get consistent spacing around = and such?

thomasahle commented 3 years ago

There's a lot of duplication now between position fen ... and position startpos .... Can you merge them into one simple if?

bobtie commented 3 years ago

Sure, I'm working on it.

thomasahle commented 3 years ago

Looks good! Thanks!