Skip to the content

Narabe並べ

Play forty-eight abstract board games through immutable moves, legal choices and replayable records.

Narabe means arranging in Japanese, as in gomoku-narabe: five in a row. About the name

Contents

Reference

React hook

import { … } from "@johnmorrisdotca/narabe/react";

27.1 kB minified and gzipped, with everything it imports (measured with esbuild)

useNarabe, a React hook over the engine: one game's state and the moves a board can make on it. It adds no rule of its own; every action is the engine function of the same name, and an illegal one leaves the state as it was, exactly as the engine does.

Drawing the board is left to you, because every app draws its boards its own way. The demo in this repository draws one in plain SVG.

Exports

NameKindWhat it is
NarabeGametypeA React game state and its native move, replay and reset actions.
useNarabefunctionOne game, kept in React state.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/narabe 1.3.0.