bedard / hexchess
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 2
Language:Rust
Requires
- symfony/yaml: ^7.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.84
- pestphp/pest: ^3.8
This package is auto-updated.
Last update: 2025-08-18 16:27:07 UTC
README
A cross-language library for GliĆski's hexagonal chess, and the brain of hexchess.club.
Libraries
Game libraries are available in Rust, PHP, and TypeScript / JavaScript. These libraries have similar APIs and abilities, but are designed for different purposes.
For game logic, use the PHP or TypeScript / JavaScript libraries. They use a position-centric game state, and are not optimized for performance. In other words, the board is stored as a flat array of values. This improves the ergonomics for game rules and rendering.
For engines, use the Rust crate. It's optimized for performance, and uses bitboards to represent the game state. This allows for fast board querying using u128
bitmasks.
Versioning
Each library is tested against a shared test suite, and are versioned together with respect to these tests. Because of this, if a change is made in one library, it will cause the version numbers for all libraries to increment.
Put simply, the libraries are versioned together to to ensure they support the same test suite, allowing for reliable interop with one another.
Local development
Depending on which library you're working on, you'll need to install a few dependencies.
First, clone the repository, and setup the CLI.
git clone git@github.com:scottbedard/hexchess.git
cd hexchess
pnpm install
Next run node hexchess
to see the following commands.
Usage: hexchess [options] [command]
Options:
-h, --help display help for command
Commands:
build Build all projects
build:js Build NPM package
build:rs Build Rust crate
lint:php Run linting
release [options] [version] Set the version of the project
test Run all tests
test:js [options] Run JavaScript tests
test:php [options] Run PHP tests
test:rs [options] Run Rust tests
versions [options] Check the versions of the dependencies
help [command] display help for command
License
Copyright (c) 2024-present, Scott Bedard