Skip to main content

Reversi42: Fast AI Reversi

Project description

Reversi42

Reversi42 Logo

GitHub Release PyPI Version Python >= 3.9 Tested: Python 3.9, 3.10, 3.11, 3.12 PyPI Downloads PyPI Status PyPI Format CI Code Coverage Security Docs License

Tournament-grade Reversi with AI-powered opponents
50-100x faster • 11 AI players • 644 opening sequences • Modern web interface


Reversi42 Screenshot


🚀 Quick Start

pip install reversi42
reversi42

Open http://localhost:8000 in your browser and start playing!


✨ Features

🎯 High-Performance Engine

  • Bitboard architecture - 50-100x faster than traditional implementations
  • Advanced AI algorithms - Alpha-beta pruning, transposition tables, parallel search
  • Configurable depth - From beginner (3 ply) to expert (16 ply)

🤖 11 AI Opponents

  • ELO ratings: 1250-1880 (beginner to expert)
  • Unique strategies: Adaptive, defensive, aggressive, tactical, chaotic
  • YAML-based configuration - Create custom AI players without coding

📚 Professional Opening Book

  • 644 tournament sequences - Derived from professional play
  • Trie-based lookup - Instant move suggestions
  • Multiple evaluation modes - Balanced and tactical openings

🌐 Modern Web Interface

  • Real-time gameplay - FastAPI + WebSocket for instant updates
  • Game management - Save/load games in XOT format
  • Live analysis - Move evaluation and position visualization

🏆 Tournament System

  • Automated competitions - Benchmark AI players
  • Statistical analysis - Comprehensive performance metrics
  • Custom configurations - Flexible tournament setups

🎮 AI Players

Player ELO Strategy Depth Style
DIVZERO.EXE 1880 Adaptive 8/12/16 Maximum strength, parallel processing
The Oracle 1850 Endgame Focus 7/9/14 Endgame specialist, parity evaluation
Apocalyptron 1850 Balanced Adaptive Strong balanced AI
Fortress Eternal 1800 Defensive 10 Defensive specialist
The Executioner 1770 Aggressive 9 Aggressive, mobility-focused
The Strangler 1750 Mobility Control 11 Restricts opponent mobility
Corner Reaper 1720 Positional 8 Corner control specialist
Glitch Lord 1500±200 Chaotic Variable Unpredictable, randomized
Lightning Strike 1400 Speed 4 Fast-playing
Blitz Demon 1350 Rapid Fire 5 Ultra-fast
Zen Master 1250 Balanced 3 Beginner-friendly

📖 View detailed player profiles →


📦 Installation

From PyPI

pip install reversi42

From Source

git clone https://github.com/lookee/Reversi42.git
cd Reversi42
pip install -e .

Requirements: Python 3.9+


🎨 Custom AI Players

Create your own AI opponents using YAML configuration files—no programming required!

cp config/players/00_AI_CONFIG_TEMPLATE.yaml config/players/enabled/my_ai.yaml
# Edit the configuration file
reversi42  # Your player is automatically discovered!

📚 Configuration Guide →


📊 Performance

  • Speed: 50-100x faster than array-based implementations
  • Search Depth: 4-16 ply (configurable)
  • Parallel Processing: Multi-core support
  • Memory: Optimized data structures

📖 Documentation


🧪 Testing

# Run test suite
./scripts/run_tests.sh

# With coverage
pytest --cov=src tests/

571+ tests covering unit, integration, and characterization scenarios.

Test Coverage by Module

  • Apocalyptron AI Engine: 800+ tests (evaluation, ordering, pruning, cache, search, observers)
  • Board Module: 34 tests (BoardModel, BoardControl, ViewFactory)
  • Players Module: 60+ tests (PlayerFactory, PlayerHuman, PlayerApocalyptron, config system)
  • Core Module: 34 tests (config, game_config)
  • Infrastructure: 10 tests (persistence/game_io)
  • Integration Tests: 50+ tests (board integrity, player isolation, book instant mode)
  • Bitboard Tests: Comprehensive move generation tests
  • WebGUI Tests: Backend server, WebSocket observer, E2E tests

📈 Project Stats

  • ~17,000 lines of Python code
  • 571+ tests with comprehensive coverage (target: 80%+)
  • 42 test files organized by module
  • 40+ documentation files
  • 11 AI players pre-configured
  • 644 opening sequences from professional play

📄 License

GNU General Public License v3.0 or later
See LICENSE for details.


👤 Author

Luca Amore
🌐 www.lucaamore.com
📧 luca.amore@gmail.com


🙏 Acknowledgments

  • Donato Barnaba and Federazione Italiana Gioco Othello (FNGO) - Reversi expertise
  • PointyStone3 Project - Opening book contributions

Reversi42 - Professional-grade Reversi for players and researchers
GitHubPyPIIssues

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reversi42-7.0.12.tar.gz (40.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reversi42-7.0.12-py3-none-any.whl (333.8 kB view details)

Uploaded Python 3

File details

Details for the file reversi42-7.0.12.tar.gz.

File metadata

  • Download URL: reversi42-7.0.12.tar.gz
  • Upload date:
  • Size: 40.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reversi42-7.0.12.tar.gz
Algorithm Hash digest
SHA256 9f784f14fbb046aa31ac0ef5600efecced8e9c73db992a0f6f08f56bbf2a22d1
MD5 c0b5a9e364c21bbb245b7576220498f0
BLAKE2b-256 f3b82ab467f63b112a995f73bee73b1aa5b4306fd67033f47b827ec478fd1b1e

See more details on using hashes here.

File details

Details for the file reversi42-7.0.12-py3-none-any.whl.

File metadata

  • Download URL: reversi42-7.0.12-py3-none-any.whl
  • Upload date:
  • Size: 333.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for reversi42-7.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 45c6eed4376f62a0d217debe26ec550a437fc98a0be8abbc155c4229fb0906ec
MD5 dd6edbdd7c0f14b0e0ee024ae5347239
BLAKE2b-256 86b147e42d934d219d3579a1ec1f75aa73171f37f83d93695864090a3d7fec18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page