Comment Comment by thrw21 https://news.ycombinator.com/item?id=39066345You could probably modify this solution, I am already using 3 bits for piece type0-3 rook queen bishop knight4 Non-moved king (can castle)5 moved king6 pawn that moved 2 squares last turn (can be captured using en passant)7 other pawnsAnd then a single extra bit to store whose turn it is parent thrw21 2 years ago
You could probably modify this solution, I am already using 3 bits for piece type
0-3 rook queen bishop knight
4 Non-moved king (can castle)
5 moved king
6 pawn that moved 2 squares last turn (can be captured using en passant)
7 other pawns
And then a single extra bit to store whose turn it is