quaternits
v0.1.0
Published
Unofficial, community-driven headless TypeScript rules library for the four-player game Quaternity.
Readme
QuaterniTS
QuaterniTS is an unofficial, community-driven headless TypeScript rules library for Quaternity, a four-player chess-inspired game. It models the 12 × 12 board, legal moves and game state for applications, education and research. It is not a UI, server, AI or board renderer.
QuaterniTS is not affiliated with, sponsored by, or endorsed by the rights holders of the official game. The MIT license covers this project's original work, not third-party names, rules text, trademarks or artwork. The project is developed free of charge without monetization; this intention does not limit anyone's rights under the MIT license.
Install
npm install quaternitsQuick start
import { Quaternity } from "quaternits";
const game = new Quaternity(); // 64-piece starting position; White moves first.
console.log(game.turn(), game.moves());
const event = game.move({ from: "b4", to: "c2" });
console.log(event.selection, game.outcome());
const saved = game.snapshot(); // Versioned JSON for replay and restoration.
const restored = new Quaternity();
restored.loadSnapshot(saved);The package provides typed moves, attack and check queries, draw and
administrative actions, history, undo, and versioned snapshots. Its API is
inspired by chess.js where useful but does not support chess.js notation or
formats such as SAN, FEN or PGN. Where an official game outcome is unknown,
the library fails closed with UnresolvedAdjudicationError rather than inventing
a result; see its bounded rules scope.
Links
- Getting started and public API
- Usage examples and compatibility guide
- Rules and examples and scope
- Contributing and license
- Official basic rules and illustrated quick rules
