game

package
v0.0.0-...-5811b38 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentScore

type CurrentScore struct {
	Low     int
	High    int
	Guesses int
}

CurrentScore -

type HighLow

type HighLow struct {
	ActualValue int
	State       States
	CurrentScore
}

HighLow -

func NewHighLow

func NewHighLow() *HighLow

NewHighLow - Create new game

func (*HighLow) GetState

func (h *HighLow) GetState() (s States)

GetState -

func (*HighLow) Guess

func (h *HighLow) Guess(guess int) (hit bool, err error)

Guess - execute a guess

type States

type States int

States -

const (
	// GameInitialized -
	GameInitialized States = iota
	// GameRunning -
	GameRunning
	// GameFinished -
	GameFinished
)

Jump to

Keyboard shortcuts

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