minesweeper

package
v0.0.0-...-5cc4ecd Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	StartPosition string     `json:"start"`  // Position in Core.Board that will never contain mines in and around it
	Width         int        `json:"width"`  // Width of the Core.Board
	Height        int        `json:"height"` // Height of the Core.Board
	Board         [][]string `json:"board"`  // Board with cells that contain mines and numbers corresponding to the number of mines around
	Mines         int        `json:"mines"`  // Total number of mines in the Core.Board
}

Core struct of Minesweeper module

func Generate

func Generate(sp string, w, h, mines int) (Core, error)

Generate a new Core with given start position, width and height of the Core.Board and total number of mines

Jump to

Keyboard shortcuts

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