本文へ移動

Narabe並べ

48種類の盤上ゲームを、新しい局面を返す手の操作、合法手の一覧、再生できる棋譜で扱えます。

「並べ」は五目並べの「並べ」。石を並べることを表す言葉です。 名前について(英語)

目次

リファレンス

Reactフック

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

最小化と gzip 圧縮をしたサイズは 27.1 kB(読み込むものをすべて含み、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.

エクスポート

名前種類概要
NarabeGame型A React game state and its native move, replay and reset actions.
useNarabe関数One game, kept in React state.

ソースを見るGitHub で編集@johnmorrisdotca/narabe 1.3.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。