generic-min-max
Version:
This node.js module exports a generic min-max algorithm, alongside some implementations This package comes with full typescript support!
22 lines (21 loc) • 756 B
TypeScript
import { BoardGameState, Game } from "../types";
export declare enum Square {
Empty = "-",
X = "X",
O = "O"
}
export declare type Player = Square.X | Square.O;
export declare type Row = [Square, Square, Square];
export declare type Board = [Row, Row, Row];
export declare type SquareLocation = [row: number, column: number];
export interface TicTacToeState extends BoardGameState {
board: Board;
}
declare class TicTacToeGame implements Game<TicTacToeState> {
constructor(initialState?: TicTacToeState);
initialState: TicTacToeState;
getAllNextStates(state: TicTacToeState): TicTacToeState[];
getHeuristic(state: TicTacToeState): number;
}
export declare function printState(state: any): void;
export default TicTacToeGame;