stackUpComputerfunction
The move a computer makes: the best play it has, or else the card it would miss least, put where it does least harm.
Import it
import { stackUpComputer } from "@johnmorrisdotca/toranpu/stack-up";
Definition
function stackUpComputer(game: StackUpGame): StackUpMove
Parameters
| Name | Type | Description |
|---|---|---|
game | StackUpGame | The current native game; applying a move returns a new state. |
Returns
StackUpMove
The move a computer makes.
Examples
import { stackUpComputer, startStackUp } from "@johnmorrisdotca/toranpu/stack-up";
console.log(stackUpComputer(startStackUp(15, ["Aki", "Ben"], undefined, 42)!));{ play: 'n01', from: 'hand', to: 0 }What it prints (run when this page was built)