nkarve / surge

A fast bitboard-based chess move generator in C++
MIT License
63 stars 15 forks source link

Setting en passant square via Position::set doesn't work #17

Open redbullmarky opened 2 years ago

redbullmarky commented 2 years ago

Given the following snippet of test code:

Position p;
Position::set("rnbqkbnr/ppppppp1/8/8/5NPp/8/PPPPPP1P/RNBQKB1R b KQkq g3 0 3", p);

When I output p.fen() it does not respond with the enpassant square & counters. Looking into the surge code, the problem appears to be that Position::set doesn't deal with anything past the castling flags.

I've been using the library to validate moves in my own code, but not being able to set the enpassant means that it reports one less available move than should be possible.

nkarve commented 2 years ago

@redbullmarky Thanks for mentioning this. The whole Position::set function needs an overhaul, and I will update this very soon.