Documentation ¶
Index ¶
- Constants
- func GetXY(index uint8) (x, y uint8)
- func Loop(fn func(uint8, uint8))
- type Board
- type Player
- type Spot
- type State
- type TicTacToe
- func (t *TicTacToe) GetBoardAsString() string
- func (t *TicTacToe) GetFreeSpots() []Spot
- func (t *TicTacToe) GetRandomFreeSpot() (Spot, error)
- func (t *TicTacToe) HasWinner() bool
- func (t *TicTacToe) InRow(current uint8) bool
- func (t *TicTacToe) MakeTurn(x, y uint8) error
- func (t *TicTacToe) SelectRandomPlayer() Player
- func (t *TicTacToe) Start()
- func (t TicTacToe) String() string
- func (t *TicTacToe) ToggleTurn() Player
Constants ¶
View Source
const ( // MaxInt maximum field value MaxInt = 0xFF // MinInt minimum field value MinInt = -0xFF )
View Source
const ( // Height is also same Width = 3 Height = 3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TicTacToe ¶
func CreateFromField ¶
CreateFromField is a method to quickly create TicTacToe structure
func GetNewGameState ¶
func (*TicTacToe) GetBoardAsString ¶
func (*TicTacToe) GetFreeSpots ¶
func (*TicTacToe) GetRandomFreeSpot ¶
func (*TicTacToe) SelectRandomPlayer ¶
func (*TicTacToe) ToggleTurn ¶
Click to show internal directories.
Click to hide internal directories.