tictactoe

package
v0.0.0-...-8be9ec9 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTicTacToeGame

func NewTicTacToeGame() games.Game

Types

type TicTacToe

type TicTacToe struct {
}

func (*TicTacToe) Example

func (t *TicTacToe) Example() string

Example implements games.Game.

func (TicTacToe) Name

func (TicTacToe) Name() string

Name implements games.Game.

func (*TicTacToe) NewState

func (t *TicTacToe) NewState() interface{}

NewState implements games.Game.

func (*TicTacToe) OnMsg

func (t *TicTacToe) OnMsg(session *models.GameSession, msg games.GameMsg) (interface{}, games.GameReply, error)

OnMsg implements games.Game.

func (*TicTacToe) Summary

func (t *TicTacToe) Summary() string

Summary implements games.Game.

type TicTacToeState

type TicTacToeState struct {
	Fields   []int // 0 = empty, 1 = PlayerA, 2 = PlayerB
	PlayerA  string
	PlayerB  string
	WhosTurn int // 1 = PlayerA, 2 = PlayerB
	Ended    bool
}

Jump to

Keyboard shortcuts

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