A Julia package that implements chess from scratch alongside a chess engine, Orbis. It provides functionalities to represent the chessboard, validate moves, and evaluate positions. Particularly, OrbisChessEngine implements:
- All chess rules
- Bitboard representation
- Legal move generation (tested with perft)
- FEN parsing
- Opening book support
- Minimax search with alpha–beta pruning, iterative deepening, quiescence search, transposition tables, null move pruning, and move ordering heuristics
- Evaluation function based on piece-square tables
OrbisChessEngine can be installed directly from the Julia package manager.
In the Julia REPL, press ] to enter the Pkg mode, then run:
pkg> add OrbisChessEngineHere we show an example of how to let the engine play a "1+1" game against itself and plot it afterwards to view it.
game = Game("1+1")
plots = []
while game_status(game.board) == :ongoing
engine_move!(game)
push!(plots, display(game))
end
for i in eachindex(plots)
sleep(0.5)
display(plots[i])
endView the documentation at https://BjarkeHautop.github.io/OrbisChessEngine.jl/dev/.
Visit chess programming wiki for useful articles on chess engine programming: https://www.chessprogramming.org/Main_Page.
-
Improve search performance by minimizing allocations
-
Improve evaluation function (e.g. add pawn structure, king safety, trapped pieces, etc.)
-
Add support for multiple threads in search (e.g. lazy SMP)
-
Implement (some of) UCI protocol
-
Make executable with PackageCompiler.jl
-
Add magic bitboards for faster move generation (added for bishops, but not yet used. Minimal performance improvement observed - see Benchmarks for details.)
-
Implement into Lichess bot (see https://github.com/lichess-bot-devs/lichess-bot)
