pig

package
v0.0.0-...-df006db Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageID

type MessageID int

type PigGameData

type PigGameData struct {
	// contains filtered or unexported fields
}

func New

func New() *PigGameData

Creates an intializes a new PigGameData structure, returns a *PigGameData

func (*PigGameData) GameOver

func (pg *PigGameData) GameOver() bool

Check if the game is over

func (*PigGameData) Hold

func (pg *PigGameData) Hold()

func (*PigGameData) NextPlayer

func (pg *PigGameData) NextPlayer()

func (*PigGameData) Play

func (pg *PigGameData) Play(id StrategyID) (keepPlaying bool)

Play a given strategy

func (*PigGameData) PlayerScore

func (pg *PigGameData) PlayerScore(id PlayerID) int

Get the score for a given player

func (*PigGameData) PrintStatus

func (pg *PigGameData) PrintStatus(id MessageID)

Print a status message, if pg.Verbose is true

func (*PigGameData) Winner

func (pg *PigGameData) Winner() PlayerID

Returns the Player ID if there is a winner, or -1

type PlayerID

type PlayerID int

type StrategyID

type StrategyID int

Jump to

Keyboard shortcuts

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