114 lines
2.2 KiB
Markdown
114 lines
2.2 KiB
Markdown
|
ChessFriend
|
||
|
===========
|
||
|
|
||
|
A chess engine written in Rust.
|
||
|
|
||
|
The project is divided into crates for major components of the engine. These
|
||
|
crates are collected in a Cargo workspace. All crates have the `chessfriend_`
|
||
|
naming prefix. The directory structure omits this prefix, and I also frequently
|
||
|
do when referring to them.
|
||
|
|
||
|
|
||
|
|
||
|
## Engine Crates
|
||
|
|
||
|
The engine is divided into several crates, each providing vital types and
|
||
|
functionality.
|
||
|
|
||
|
|
||
|
|
||
|
### `core`
|
||
|
|
||
|
A collection of types for representing core concepts in a chess game and the
|
||
|
engine. Types like `Color` (player or piece color), `Shape` (the shape of a
|
||
|
piece: knight, etc), `Piece` (a piece of a particular color and shape), and
|
||
|
`Score` (for scoring a board position) live here.
|
||
|
|
||
|
|
||
|
|
||
|
### `bitboard`
|
||
|
|
||
|
Implements an efficient BitBoard type. Bitboards use a 64-bit bit field to mark a
|
||
|
square on a board as occupied or free.
|
||
|
|
||
|
|
||
|
|
||
|
### `board`
|
||
|
|
||
|
Implements a `Board` type that represents a moment-in-time board position. FEN
|
||
|
parsing and production lives here.
|
||
|
|
||
|
|
||
|
|
||
|
### `moves`
|
||
|
|
||
|
The `Move` type lives here, along with routines for encoding moves in efficient
|
||
|
forms, parsing moves from algebraic notation, and recording moves in a game
|
||
|
context. Additionally, the move generators for each shape of piece are here.
|
||
|
|
||
|
|
||
|
|
||
|
### `position`
|
||
|
|
||
|
Exports the `Position` type, representing a board position within the context of
|
||
|
a game. As such, it also provides a move list, and methods to make and unmake
|
||
|
moves.
|
||
|
|
||
|
|
||
|
|
||
|
## Support Crates
|
||
|
|
||
|
These crates are for debugging and testing.
|
||
|
|
||
|
|
||
|
|
||
|
### `explorer`
|
||
|
|
||
|
This crate implements a small command-line application for "exploring" board
|
||
|
positions. I meant for this program to be a debugging utility so that I could
|
||
|
examine bitboards and other board structures live. It has grown over time to
|
||
|
also support more aspects of interacting with the engine. So you can also use it
|
||
|
to play a game!
|
||
|
|
||
|
|
||
|
|
||
|
### `perft`
|
||
|
|
||
|
A small Perft utility that executes perft to a given depth from some starting
|
||
|
position.
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
## Building
|
||
|
|
||
|
Build the engine in the usual Rusty way.
|
||
|
|
||
|
```sh
|
||
|
$ cargo build
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
## Testing
|
||
|
|
||
|
Test in the usual Rusty way.
|
||
|
|
||
|
```sh
|
||
|
$ cargo test
|
||
|
```
|
||
|
|
||
|
The engine has a fairly comprehensive unit test suite, as well as a decent pile
|
||
|
of integration tests.
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
## Authors
|
||
|
|
||
|
This engine is built entirely by me, Eryn Wells.
|