Commit graph

15 commits

Author SHA1 Message Date
8dc1e859e0 [chessfriend] Empty crate
The idea for this crate is that it'll be the entry point for interacting with
the chess engine.
2025-06-16 19:29:57 -07:00
0167794346 [perft] A small Perft program 2025-06-08 17:19:00 -07:00
d7f426697d [board, position] Implement Zobrist hashing
This change builds on several previous changes to implement Zobrist hashing of the
board. This hash can be updated incrementally as changes are made to the board.
In order to do that, various properties of the Board struct had to made internal.
In the setters and various mutating members of Board, the hash is updated as
state changes.

The entire hashing mechanism is optional. If no ZobristState is provided when the
Board is created, the hash is never computed.

Plumb the Zobrist state through Position as well so that clients of Position (the
ultimate interface for interacting with the chess engine) can provide global
state to the whole engine.

The explorer crate gives an example of how this works. Some global state is
computed during initialization and then passed to the Position when it's created.
2025-06-05 08:22:34 -07:00
6d0df32f74 [core] Random Number Generator
Implement a random number generator as a thin wrapper around rand::StdRng. Provide
some default seed data to get consistent random numbers.
2025-06-02 15:44:38 -07:00
9010f1e9c2 [explorer, moves, core] Improve error handling in explorer
Implement thiserror::Error for a bunch of error types, and remove string errors
from the implementation of the command handler in explorer.

Clean up parsing of basic types all over the place.

Update Cargo files to include thiserror and anyhow.
2025-05-19 14:18:31 -07:00
669a7c00ec [position] Add thiserror dependency 2025-05-18 08:07:12 -07:00
091cc99cb3 WIP 2025-05-08 17:37:51 -07:00
b3c472fbce Fix some imports in the moves package
Castle and EnPassant moved to the board package. Reference these types there.
Add the board packages as a dependency to the moves package.
2024-04-26 09:50:42 -04:00
1d82d27f84 Move a whole bunch of stuff to the new chessfriend_board package 2024-04-25 13:28:24 -07:00
d77345901c Add chessfriend_moves to the workspace 2024-02-25 09:52:59 -08:00
e6a9b7f8c4 Return a chessfriend_moves::EnPassant from a new Position::en_passant()
Replace Position's en_passant_target_square() and en_passant_capture_square()
with a single en_passant() method that returns a new EnPassant struct that has
the target and capture squares for the en passant move.
2024-02-11 10:23:07 -07:00
f69c7d4c96 Move a bunch of stuff from the position::move module over to a new chessfriend_moves crate 2024-02-11 10:23:07 -07:00
cac13b4bc7 Cargo.lock changes 2024-01-30 08:53:15 -08:00
3c71687838 Merge branch 'many-crates'
# Conflicts:
#	Cargo.toml
#	core/Cargo.toml
2024-01-24 09:23:35 -08:00
e522e268cf Make a Cargo Workspace! 2024-01-22 19:33:59 -08:00