VARIANTS定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Every variant. Where each comes from, and where the sources disagree or say
nothing, is in docs/VARIANTS.md.
インポート
import { VARIANTS } from "@johnmorrisdotca/sugoroku";
定義
const VARIANTS: Readonly<Record<VariantKey, VariantSpec>> = {
backgammon: { ...BASE, key: "backgammon", layout: STANDARD_LAYOUT },
"backgammon-race": { ...BASE, key: "backgammon-race", layout: [] },
"anti-backgammon": { ...BASE, key: "anti-backgammon", layout: STANDARD_LAYOUT, goal: "last-off", drawAfter: 500 },
nackgammon: {
...BASE,
key: "nackgammon",
layout: [
[24, 2],
[23, 2],
[13, 4],
[8, 3],
[6, 4],
],
},
"long-gammon": { ...BASE, key: "long-gammon", layout: [[24, 15]] },
hypergammon: {
...BASE,
key: "hypergammon",
checkers: 3,
layout: [
[24, 1],
[23, 1],
[22, 1],
],
},
tabula: {
...BASE,
key: "tabula",
layout: [],
dice: 3,
doubles: "none",
direction: "same",
opening: "die-each",
holdBelow: 12,
},
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
backgammon | VariantSpec | |
backgammon-race | VariantSpec | |
anti-backgammon | VariantSpec | |
nackgammon | VariantSpec | |
long-gammon | VariantSpec | |
hypergammon | VariantSpec | |
tabula | VariantSpec |
例
import { VARIANTS } from "@johnmorrisdotca/sugoroku";
console.log(VARIANTS);{
backgammon: {
checkers: 15,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'first-off',
holdBelow: 0,
drawAfter: 0,
key: 'backgammon',
layout: [ [Array], [Array], [Array], [Array] ]
},
'backgammon-race': {
checkers: 15,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'first-off',
holdBelow: 0,
drawAfter: 0,
key: 'backgammon-race',
layout: []
},
'anti-backgammon': {
checkers: 15,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'last-off',
holdBelow: 0,
drawAfter: 500,
key: 'anti-backgammon',
layout: [ [Array], [Array], [Array], [Array] ]
},
nackgammon: {
checkers: 15,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'first-off',
holdBelow: 0,
drawAfter: 0,
key: 'nackgammon',
layout: [ [Array], [Array], [Array], [Array], [Array] ]
},
'long-gammon': {
checkers: 15,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'first-off',
holdBelow: 0,
drawAfter: 0,
key: 'long-gammon',
layout: [ [Array] ]
},
hypergammon: {
checkers: 3,
dice: 2,
doubles: 'four',
direction: 'opposed',
opening: 'roll-off',
goal: 'first-off',
holdBelow: 0,
drawAfter: 0,
key: 'hypergammon',
layout: [ [Array], [Array], [Array] ]
},
tabula: {
checkers: 15,
dice: 3,
doubles: 'none',
direction: 'same',
opening: 'die-each',
goal: 'first-off',
holdBelow: 12,
drawAfter: 0,
key: 'tabula',
layout: []
}
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。