game

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	State struct {
		GameOver bool
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields
}

func NewGame

func NewGame(boardWidth, boardHeight, numDisarms, numMines int, chainRevealing bool) *Game

func (*Game) BoardDimensions

func (g *Game) BoardDimensions() (int, int)

func (*Game) BoardString

func (g *Game) BoardString() string

func (*Game) RevealAt

func (g *Game) RevealAt(x, y int)

Reveals the tile at a given position (x, y)

If chain is true, the block of adjacent safe tiles containing this tile is fully revealed

Sets the game over state to true if the revealed tile was a mine

func (*Game) SmartReveal

func (g *Game) SmartReveal(x, y int)

func (*Game) ToggleFlaggedAt

func (g *Game) ToggleFlaggedAt(x, y int)

func (*Game) UnflaggedMines

func (g *Game) UnflaggedMines() int

Jump to

Keyboard shortcuts

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