Documentation ¶
Index ¶
Constants ¶
View Source
const (
//SIZE is the size of the nxn board
SIZE = 5
)
Variables ¶
View Source
var ( //ErrMoveInvalid is the base error for invalid moves. ErrMoveInvalid = errors.New("squares: move is invalid") )
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
Game is the game state
func (Game) ApplyAction ¶
ApplyAction generates a new game state by placing a piece p on the board If p is an invalid action, an error is returned with an unchanged board.
func (Game) GetActions ¶
GetActions returns the list of y,x positions that can be made from this game state.
func (Game) IsTerminal ¶
IsTerminal returns true on a terminal state.
type Piece ¶
type Piece byte
Piece represents the colored piece on the board
Click to show internal directories.
Click to hide internal directories.