A fast and simple chess bot written in Rust.
Play me on Lichess.
RUSTFLAGS="-C target-cpu=native" cargo run --release
The bot uses the Chess crate for keeping track of the game state as well as fast move generation during search and evaluation. For communication with Lichess APIs, the Licheszter crate is used.
The bot listens for events from Lichess and responds accordingly.
sequenceDiagram
participant Stonksfish
participant Lichess
actor Opponent
Stonksfish->>Lichess: Listen for events
loop Running
Opponent->>Lichess: Create challenge
Lichess-->>Stonksfish: New challenge
Stonksfish->>Lichess: Accept challenge
Lichess-->>Stonksfish: Game started
rect rgb(130, 75, 20)
loop Playing game
Opponent->>Lichess: Make move
Lichess-->>Stonksfish: Updated game state
Stonksfish->>Lichess: Make move
Lichess-->>Stonksfish: Updated game state
Note right of Lichess: Assuming opponent is playing <br> White. If not, Stonksfish <br> makes the first move.
end
end
Lichess-->>Stonksfish: Game over
end