Class: AI

Chess. AI

This is the class to play the Chess game. This is where you should build your AI.

new Chess.AI()

Methods

ended(won, reason)

This is called when the game ends, you can clean up your data and dump files here if need be.
Name Type Description
won boolean True means you won, false means you lost.
reason string The human readable string explaining why you won or lost.

gameUpdated()

This is called every time the game's state updates, so if you are tracking anything you can update it here.

string getName()

This is the name you send to the server so your AI will control the player named this string.
Returns: string
The name of your Player.

string makeMove()

This is called every time it is this AI.player's turn to make a move.
Returns: string
A string in Universal Chess Interface (UCI) or Standard Algebraic Notation (SAN) formatting for the move you want to make. If the move is invalid or not properly formatted you will lose the game.

start()

This is called once the game starts and your AI knows its playerID and game. You can initialize your AI here.