Chessna is a simple chess engine that is designed to beat most human players.
- Bitboards
- Iterative deepening in combination with Alpha-Beta Search
- Quiescence Search
- Transposition Table
- Move ordering (MVV-LVA, Killer moves, Promotions, Castling, best move from last iteration)
- Late Move Reduction
- Null-move heuristic (still experimental)
- material difference
- position score (slightly different for endgame)
- Mop-up evaluation
- UCI (Universal chess interface): needed to communicate with lichess
- Pondering (think on opponent's time)
Compile the engine and run it:
make
build/chessnaChessna uses UCI (partially implemented) for communication. You can setup the start position or any custom position using the according FEN followed by the moves:
position startpos moves e2e4 e7e5 To calculate the best move for a certain depth type:
position 8/6p1/5n1p/3rpk2/1PB2b2/5P2/5PK1/8 b - - 0 52
go depth 9To calculate the best move given a time limit (in ms) type:
position 8/6p1/5n1p/3rpk2/1PB2b2/5P2/5PK1/8 b - - 0 52 moves d5d2 c4a6
go movetime 10000Note: The engine will only use 90% of the given time to calculate the best move. You can also tell the engine its remaining time (in ms) for a match and it will adjust its move time accordingly:
position 8/6p1/5n1p/3rpk2/1PB2b2/5P2/5PK1/8 b - - 0 52 moves d5d2 c4a6
go wtime 300000 btime 300000 Furthermore you can add an increment:
position 8/6p1/5n1p/3rpk2/1PB2b2/5P2/5PK1/8 b - - 0 52 moves d5d2 c4a6
go wtime 300000 btime 300000 winc 2000 binc 2000 You can also use a GUI to run Chessna. So far I've only tested that it works with Lichess as I use lichess-bot to let Chessna play against other bots and players.
- LAZY SMP: multithreading
- Opening Book
- better evaluation (king safety, mobility, pawn structure, ...)
- improve move generation (use array instead of vector, magic bitboards etc.)