drawSugoroku関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The board as SVG text for position. The variant says how the sides' points
line up; pass the same one the game is played with.
インポート
import { drawSugoroku } from "@johnmorrisdotca/sugoroku/draw";
定義
function drawSugoroku(position: Position, options?: SugorokuDrawOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
position | Position | The native checker counts, bar, reserve and borne-off counts. |
options (省略可) | SugorokuDrawOptions | Native drawing, geometry, mounting or computer choices specified by the signature. |
戻り値
string
The board as SVG text for position. The variant says how the sides' points line up; pass the same one the game is played with.
例
import { settingsFor, startPosition } from "@johnmorrisdotca/sugoroku";
import { drawSugoroku } from "@johnmorrisdotca/sugoroku/draw";
const settings = settingsFor("backgammon",{points:5,cube:true});
const spec = settings.variant;
const position = startPosition(spec);
console.log(drawSugoroku(position,{variant:"backgammon",label:"Starting board"}).startsWith("<svg"));true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。