Movetype
A move rebuilt by the engine, including captures and other replay effects.
Import it
import type { Move } from "@johnmorrisdotca/narabe";
Definition
type Move = Point & {
stone: Stone;
by?: Stone;
kind: MoveKind;
captured?: Point[];
from?: Point;
twist?: Twist;
cleared?: Cell[];
cells?: PieceCell[];
wasKing?: boolean;
capturedWasKing?: boolean;
continuedChain?: boolean;
crowned?: boolean;
forced?: boolean;
headStart?: boolean;
koPointBefore?: Point | null;
};
Members
| Name | Type | Description |
|---|---|---|
row | number | |
col | number | |
stone | Stone | The colour of the stone placed. |
by (optional) | Stone | undefined | The colour that moved, when the game lets a mover place the other colour. |
kind | MoveKind | |
captured (optional) | Point[] | undefined | Opponent stones this move took off the board, in the capture variants. |
from (optional) | Point | undefined | Where a moving piece came from. Only on |
twist (optional) | Twist | undefined | The twist that finished this move, once it has been made. |
cleared (optional) | Cell[] | undefined | The bottom row this move cleared, so it can be put back by an undo. |
cells (optional) | PieceCell[] | undefined | The cells a piece covered, with their colours, on |
wasKing (optional) | boolean | undefined | Whether the piece making this move was already a king. Checkers only, for undo. |
capturedWasKing (optional) | boolean | undefined | Whether the piece this move captured was itself a king. Checkers only, for undo. |
continuedChain (optional) | boolean | undefined | Whether this move continued a capture chain already under way. Checkers only, for undo. |
crowned (optional) | boolean | undefined | Whether this move crowned the piece that made it. Checkers only, and only where it did: an endgame count reads the record back to the move that entered its ending, and a man becoming a king changes which ending it is. |
forced (optional) | boolean | undefined | On a pass: whether it was forced — the colour had nothing it could play —
rather than chosen, as a pass in Go is. Set by |
headStart (optional) | boolean | undefined | On a pass: whether it was a turn the other colour's head start took —
see |
koPointBefore (optional) | Point | null | undefined | The ko point in force just before this move, so undo can put it back. Go only. |
Examples
import type { Move } from "@johnmorrisdotca/narabe";
const value: Move = {row:7,col:7,stone:"black",kind:"place"};
console.log(value);{ row: 7, col: 7, stone: 'black', kind: 'place' }What it prints (run when this page was built)