Magpie
Magpie is a high-performance Othello library built with bitboards and zero dependencies.
Magpie offers two abstraction levels:
- Game API: rule-checked, turn-aware game logic and state management. Enforces legal moves and tracks turns.
- Board API: lower-level, unchecked board operations for maximum performance. Useful when building engines.
Getting Started
use ;
let mut game = new;
// Black moves first in Othello
assert_eq!;
// Pick the first available move and play it
let pos = game.moves.hot_bits.next.unwrap;
game.play?;
println!;
assert_eq!;
assert_eq!;
Installation
# Serde support is available through the serde feature flag.
Examples
Examples are described here.
Curious to play? One example features a functional Othello game with a random AI opponent. Run cargo run --example human_vs_ai to start a game!
Benchmarks
Benchmarks are described here
Run the benchmarks with cargo bench.