Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: compressed board #109

Merged
merged 4 commits into from
Aug 22, 2024
Merged

feat: compressed board #109

merged 4 commits into from
Aug 22, 2024

Conversation

Disservin
Copy link
Owner

@Disservin Disservin commented Aug 21, 2024

API:

using PackedBoard = std::array<std::uint8_t, 24>;

normal

Board board     = Board("4k1n1/pppppppp/8/8/8/8/PPPPPPPP/4K3 b - - 0 1");
auto compressed = Board::Compact::encode(board);
auto newboard   = Board::Compact::decode(compressed);

chess960

Board board = Board("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w AHah - 0 1", true);

auto compressed = Board::Compact::encode(board);
auto newboard   = Board::Compact::decode(compressed, true);

@Disservin Disservin marked this pull request as ready for review August 22, 2024 17:34
@Disservin Disservin merged commit 3f7efd6 into master Aug 22, 2024
3 checks passed
@Disservin Disservin deleted the compressed-board branch August 22, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant