Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can have only one en passant situation on the board at once. This means you can use 3 bits to encode the column for en passant, you check the board to evaluate the legality of the solution and discard if it isn't legal (this means you don't have to use a bit to encode whether it's possible as the encoder is guaranteed to be able to pick a column that it's not possible.)


You can have two pawns in the same column in plausible en passant position after pawns cross over via capture.

Of course after a capture you have more bits free, but you need to do something more complex than encoding the column.


I think we are both wrong. En passant only exists for one move, whatever has happened from captures is irrelevant. However, now I realize you can have two possible en passant captures at once--a pawn moves to 4th rank between two opposing pawns on the 4th rank.


That's just not true. Pawns can only be captured en passant on one rank for each color.


Yes for each color. That means two pawns for each column can be in position to be captured en passant. And also two pawns can be in capturing position.

Edit: Column combined with whose turn it is will work, but not just column.


Part of a chess position is whose turn to move. That has to be encoded anyways.


I guess, but the article wasn't trying to do so.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: