HitotsuView型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A COMPUTER AT THE HITOTSU TABLE. It sees its own hand, the pile, the colour to follow, what it faces, and how many cards each player holds — never another hand, and never whether a Wild Draw Four it faces was a bluff.
- Facing a draw, it stacks if it can (a Draw Two before a Wild Draw Four), and otherwise takes it — or challenges a Wild Draw Four played by a hand big enough that it most likely held the colour.
- On its turn it plays an ordinary card when it has one: an action card at the player next to go out, else the card that keeps it in the colour it holds most of and sheds the most points. Wilds are saved for when nothing else goes, and a Wild Draw Four for last, and it never bluffs one.
- A seven swaps with the smallest hand; a colour called is the one it holds most of. It always calls "Hitotsu!", and jumps in whenever it can.
- With nothing to play it draws, and plays the card drawn if it goes and is not a wild (which it keeps).
インポート
import type { HitotsuView } from "@johnmorrisdotca/hitotsu";
定義
type HitotsuView = {
seat: number;
hand: readonly HitotsuCard[];
counts: readonly number[];
colour: HitotsuColour;
next: number;
drawn: HitotsuCard | null;
challengeFrom: number | null;
legal: readonly HitotsuMove[];
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
seat | number | |
hand | readonly string[] | |
counts | readonly number[] | |
colour | HitotsuColour | |
next | number | The seat that plays after this one, as things stand. |
drawn | string | null | |
challengeFrom | number | null | A Wild Draw Four this seat may challenge: who played it. Nothing of whether it was a bluff. |
legal | readonly HitotsuMove[] |
例
import type { HitotsuView } from "@johnmorrisdotca/hitotsu";
import { hitotsuView, startHitotsu } from "@johnmorrisdotca/hitotsu";
const value: HitotsuView = hitotsuView(startHitotsu(1, ["Aki", "Ben"], 42)!, 0);
console.log(value.counts);[ 7, 7 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。