GameAPI
A game of chess.
A game is played between two players, white and black.
Attributes
- Todo
-
add clocks
keep move orders somewhere
draw rules (50 moves, 3 positions)
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
Access the board of the game.
Access the board of the game.
Attributes
- Returns
-
The board.
Convert a string position to its int tuple equivalent.
Convert a string position to its int tuple equivalent.
The given string is suppose to already be of good quality.
Value parameters
- input
-
The string position to convert.
Attributes
- Returns
-
The square coordinate in matrix conventions.
Play a turn of chess.
Play a turn of chess.
The function start by verifying if the game is not over (checkmate or stalemate).
If not, the player of which it's the turn pick a piece and then pick a position to move this piece.
Attributes
Check if the input position is of the right format.
Check if the input position is of the right format.
This function checks if the given position is a correct chess square, i.e of the form a1 -> h8
Value parameters
- input
-
The given input.
Attributes
- Returns
-
true if the input is a correct position, false otherwise.
Access the winner of the game.
Access the winner of the game.
If it's a stalemate, the winner is set to "_"
Attributes
- Returns
-
The winner.
Concrete fields
A list of all the pieces of the given color.
A list of all the pieces of the given color.