daylen / stockfish-mac

Beautiful, powerful chess app for the Mac
http://stockfishchess.org/mac/
GNU General Public License v3.0
511 stars 116 forks source link

Correctly check for missing castling rights or en passant information in Position::is_valid_fen #14

Closed jpulgarin closed 10 years ago

jpulgarin commented 10 years ago

Incorrect checking of missing castling rights or en passant information was leading to Position::is_valid_fen declaring valid FEN strings as invalid.

For example, the following string would be declared as invalid:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq

This fix correctly checks for this missing information, and adds some tests including two which should fail without this fix. I wasn't able to run the tests because I ran into some problems with Xcode.

By the way, love the app!

daylen commented 10 years ago

Thanks! I ran the tests and they all passed. I just merged your pull request.