UNPKG

piskvorky

Version:

Helper functions for tic-tac-toe game.

19 lines (18 loc) 650 B
export declare const playerO: "o"; export declare const playerX: "x"; export declare const empty: "_"; export declare const outOfBounds = "out-of-bounds"; export declare const tie = "tie"; export type PlayerO = typeof playerO; export type PlayerX = typeof playerX; export type Empty = typeof empty; export type OutOfBoundsField = typeof outOfBounds; export type Tie = typeof tie; export type Field = PlayerO | PlayerX | Empty; export type Board = Readonly<Readonly<Field[]>[]>; export type FlatBoard = Readonly<Field[]>; export type Winner = PlayerO | PlayerX | Tie | null; export type Position = { x: number; y: number; };