tictactoe

package
v0.0.0-...-6b15219 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

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

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

func (a *Agent) DisplayName() string

DisplayName returns "Robby The Robot"

func (*Agent) Name

func (a *Agent) Name() string

Name returns "ai"

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL