Documentation ¶
Overview ¶
Package checkers is a checkers board game engine.
Index ¶
Constants ¶
View Source
const ( //ROWS is the number of rows in a checkers board ROWS = 8 //COLS is the number of cols in a checkers board //this variable is represented as half the amount of the columns //on a typical checkers board as half of the slots on the board are //unused. This implementation takes use of that to save on memory COLS = 4 )
View Source
const ( //TurnsBeforeDraw is the number of turns the engine //wil consider before resulting in a draw if a piece //capture has not occurred in that alloted time. TurnsBeforeDraw = 100 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
Game is the base struct that holds game state information.
func (Game) ApplyAction ¶
ApplyAction takes a Move and applies the action to the current game state.
Returns the new game state and ErrMoveNotInBounds if the Move m is invalid.
func (Game) GetActions ¶
GetActions returns a list of moves that can be made by the current player.
func (Game) IsTerminalState ¶
IsTerminalState returns whether the game is finished or not.
type Move ¶
type Move struct {
// contains filtered or unexported fields
}
Move represents an action in checkers
Click to show internal directories.
Click to hide internal directories.