#bitboard #othello #reversi #operation

magpie

High-performance Othello library built with bitboards

16 releases (10 breaking)

Uses new Rust 2024

new 0.11.2 Mar 22, 2025
0.11.1 Apr 17, 2024
0.11.0 Feb 15, 2023
0.10.0 Sep 15, 2022
0.2.0 Nov 18, 2020

#173 in Game dev

Download history 14/week @ 2024-12-04 26/week @ 2024-12-11 91/week @ 2024-12-25 20/week @ 2025-01-29 19/week @ 2025-02-05 18/week @ 2025-02-12 2/week @ 2025-03-12 150/week @ 2025-03-19

152 downloads per month
Used in 2 crates

MIT license

66KB
947 lines

CI status Latest version

Magpie

Magpie logo

Magpie is a high-performance library for the classic board game Othello. It provides both a user-friendly API and a low-level interface suitable for AI engines.

Key Features

  • Built with bitboards: Uses bitboards for extremely fast board operations
  • Zero dependencies: Core functionality has no external dependencies
  • Optional Serde support: Serialization available through an optional feature flag

Furthermore, the library offers two abstraction levels:

  • Game API: Ensures rule compliance, tracks turns, and maintains board consistency
  • Board API: Provides raw board operations without validation, when performance is critical.

Installation

cargo add magpie
# If serialization with Serde is desired, activate the serde feature flag.
cargo add magpie -F serde

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

Simply run cargo bench to run all benchmarks.

Dependencies

~160KB