thaw-reversi-engine.ts
Version:
A Node.js Reversi (Othello) game engine with alpha-beta pruning and a heuristic, packaged for npm.
17 lines (16 loc) • 744 B
TypeScript
import { Game } from './game';
import { IFindBestMovesResult, Player } from './player';
export interface IGameState {
blackPopulation: number;
boardAsString: string;
game: Game;
isGameOver: boolean;
lastBestMoveInfo?: IFindBestMovesResult;
numPiecesFlippedInLastMove: number;
player: Player;
whitePopulation: number;
}
export declare function createInitialState(boardAsString?: string, playerToken?: string): IGameState;
export declare function moveManually(gameState: IGameState, row: number, column: number): IGameState;
export declare function moveAutomatically(gameState: IGameState, maxPly: number): IGameState;
export declare function getURLFriendlyBoardStringFromGameState(gameState: IGameState): string;