game

package
v0.0.0-...-a44ad7e Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Difficulty

type Difficulty string
const (
	BeginnerDifficulty     Difficulty = "beginner"
	IntermediateDifficulty Difficulty = "intermediate"
	ExpertDifficulty       Difficulty = "expert"
)

type DifficultySettings

type DifficultySettings struct {
	BoardSize     dimensions.Size
	NumberOfMines int
	Lives         int
}

func GetDifficultySettings

func GetDifficultySettings(difficulty Difficulty) DifficultySettings

type Game

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

func NewGame

func NewGame(lives int, board *board.Board) *Game

func (*Game) Chord

func (game *Game) Chord(x, y int)

Attempt chording at specified location. To chord, the selected cell must already be open and must have at least one adjacent mine.

When the number of adjacent mines is equal to the number of adjacent flagged cells, all adjacent non-flagged unopened cells will be opened.

func (*Game) Ended

func (game *Game) Ended() bool

func (*Game) Flag

func (game *Game) Flag(x, y int)

func (*Game) Lives

func (game *Game) Lives() int

func (*Game) Open

func (game *Game) Open(x, y int)

func (*Game) Status

func (game *Game) Status() Gamestate

type Gamestate

type Gamestate = string
const (
	PlayingGame Gamestate = "playing"
	LostGame    Gamestate = "lost"
	WonGame     Gamestate = "won"
)

Jump to

Keyboard shortcuts

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