go-minesweeper

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 5 Imported by: 0

README

Coverage Status

Go Minesweeper

How to play

Your goal is to reveal all the tiles that don't have a mine. Revealed tiles that are adjacent to mines will have a number. This number indicates how many mines are in adjacent tiles.

  • left mouse button: reveals a tile
  • right mouse button: adds/removes a flag from a tile, preventing it from being revealed
  • left + right mouse buttons (on a revealed tile): reveales all adjacent tiles, only if enough flags are placed. This function prevents acidental mine hits.

Binaries

You can download the binaries here

Building the binaries

Prerequisites
  • Docker: Install documentation here
Building the binaries

On a terminal, from the root of the repo, run

sh cli/build.sh [build]

build: will build the docker image used to compile the code

The binaries will be available on the directory bin/

Run the game from source

Prerequisites
  1. Make sure you have the latest version of golang installed

  2. Install Fyne, the graphic library used to render the GUI

go install fyne.io/fyne/v2/cmd/fyne@latest
  1. Install Fyne's dependencies for your OS. Consult them here
Running the game

On a terminal, from the root of the repo, run

sh cli/run.sh

Development tools

Running the linters

On a terminal, from the root of the repo, run

sh cli/lint.sh [build]

build: will build the docker image used to run the linters
Running the tests

On a terminal, from the root of the repo, run

sh cli/test.sh [build] [-w] [dir1 dir2 ...]

build: will build the docker image used to run the tests
-w: run the tests in watch mode
dir1 dir2 ...: the directories to look for test files. Default is internal/
Running the test coverage

On a terminal, from the root of the repo, run

sh cli/coverage.sh [build]

build: will build the docker image used to run the tests

The output will be available on the directory coverage/

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
game
Package game handles creating and managing the state of a game
Package game handles creating and managing the state of a game
gui
minefield
Package minefield handles all create and mutate operations on the minefield type
Package minefield handles all create and mutate operations on the minefield type

Jump to

Keyboard shortcuts

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