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

Catch IndexError and single loop on score #29

Closed tijko closed 9 years ago

tijko commented 9 years ago

Hi, impressive code. I few small edits, added an exception on IndexError too.

The score could be done in one loop instead of two, this also cuts out a line ;)

thomasahle commented 9 years ago

Hey Tijko, thanks for the patch! Good idea catching IndexError in sunfish.py, I'm sure that'll help some if the confusion. I'm not quite sure the changes in xboard.py improves readability, though you're right that they make the code shorter and slightly faster. Can you split the request for now at least? :-)

tijko commented 9 years ago

Sure, I've reverted those changes.