Documentation ¶
Overview ¶
Package tictactoe is an exceedingly simple game based on boardgame. It serves as an example, and also helps verify that the design and implementation of boardgame are useful for real games.
Index ¶
- Constants
- func NewDelegate() boardgame.GameDelegate
- type Agent
- func (a *Agent) DisplayName() string
- func (a *Agent) Name() string
- func (a *Agent) ProposeMove(game *boardgame.Game, player boardgame.PlayerIndex, agentState []byte) (move boardgame.Move, newState []byte)
- func (a *Agent) SetUpForGame(game *boardgame.Game, player boardgame.PlayerIndex) (agentState []byte)
Constants ¶
View Source
const ( //X represents the x player X = "X" //O represents the o player O = "O" //Empty represents an unfilled cell Empty = "" )
TODO: this should use enums, and then PlayerStateConstructor should just use new(playerState).
Variables ¶
This section is empty.
Functions ¶
func NewDelegate ¶
func NewDelegate() boardgame.GameDelegate
NewDelegate is the primary entrypoint for this package. It returns a GameDelegate that configures a game of pig.
Types ¶
type Agent ¶
type Agent struct{}
Agent is an agent capable of playing tictactoe.
func (*Agent) DisplayName ¶
DisplayName returns "Robby The Robot"
func (*Agent) ProposeMove ¶
func (a *Agent) ProposeMove(game *boardgame.Game, player boardgame.PlayerIndex, agentState []byte) (move boardgame.Move, newState []byte)
ProposeMove is not yet implemented.
func (*Agent) SetUpForGame ¶
func (a *Agent) SetUpForGame(game *boardgame.Game, player boardgame.PlayerIndex) (agentState []byte)
SetUpForGame is not yet implemented.
Click to show internal directories.
Click to hide internal directories.