WarMovetype
The one thing a player does at War: turn the top cards over. War has no choices, so this is its only move, and a computer's turn is the same move as a person's.
Import it
import type { WarMove } from "@johnmorrisdotca/toranpu/war";
Definition
type WarMove = {
turn: true;
};
Members
| Name | Type | Description |
|---|---|---|
turn | true |
Examples
import { CARD_GAME_TABLES, newGame, rulesFor } from "@johnmorrisdotca/toranpu";
import type { WarMove } from "@johnmorrisdotca/toranpu/war";
const names = Array.from({ length: CARD_GAME_TABLES.war.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
const game = newGame("war", { players: names, seed: 42 })!;
const value: WarMove = rulesFor("war").moves(game)[0]!;
console.log(value);{ turn: true }What it prints (run when this page was built)