This project is a chess engine built in rust. It provides an engine for playing chess, and can be attached to any GUI
The engine can be interfaced through stdio with the help of the CLI.
cargo run -- --help
to see all available options.
cargo run -- -f "8/5k2/3p4/1p1Pp2p/pP2Pp1P/P4P1K/8/8 b - - 99 50" --get-moves f7 --show
The engine creates a new GameState
based on the FEN string that was passed in.
The engine is a library that is completely detatched from the CLI. This would allow anyone to hook up just the engine to an existing chess application and be able to interface with it. The CLI and potentially a server could be used for cross communication between different languages.
Each rank-file position can be represented as a 0-63 decimal number. The positions are shown in the table below. A 64bit bitmap can be used to represent an entire board. If a piece is at position H8 (63), the first bit (64) will be enabled.
R | A | B | C | D | E | F | G | H |
---|---|---|---|---|---|---|---|---|
8 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
7 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
6 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
5 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
4 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
3 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |