Handicap型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Extra restrictions one colour plays under, so a stronger player can give a weaker one a fair game. Every item is a rule some variant already imposes on a colour, applied here on top of whatever the variant says. A handicap belongs to a colour, not a seat, so seat swaps are off while one is set.
doubleThree / doubleFour / overline: shapes this colour may not make.
exactLine: this colour's overline is not a win.
openLine: this colour's winning line must not be shut in at both ends.
longerLine: this colour needs one more stone in a row.
singleStone: one stone a turn where the variant gives two.
noCaptures: this colour does not capture, in the capture variants.
secondStoneExclusion: this colour's second stone must land outside the
central square of this half-width (2 for 5×5, 3 for 7×7); 0 for none.
インポート
import type { Handicap } from "@johnmorrisdotca/narabe";
定義
type Handicap = {
stone: Stone | null;
doubleThree: boolean;
doubleFour: boolean;
overline: boolean;
exactLine: boolean;
openLine: boolean;
longerLine: boolean;
singleStone: boolean;
noCaptures: boolean;
secondStoneExclusion: number;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
stone | Stone | null | |
doubleThree | boolean | |
doubleFour | boolean | |
overline | boolean | |
exactLine | boolean | |
openLine | boolean | |
longerLine | boolean | |
singleStone | boolean | |
noCaptures | boolean | |
secondStoneExclusion | number |
例
import type { Handicap } from "@johnmorrisdotca/narabe";
import { NO_HANDICAP } from "@johnmorrisdotca/narabe";
const value: Handicap = {...NO_HANDICAP,stone:"black",doubleThree:true};
console.log(value);{
stone: 'black',
doubleThree: true,
doubleFour: false,
overline: false,
exactLine: false,
openLine: false,
longerLine: false,
singleStone: false,
noCaptures: false,
secondStoneExclusion: 0
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。