https://github.com/pedrohenriques/go-minesweeper
A minesweeper game built in Golang.
https://github.com/pedrohenriques/go-minesweeper
fyne golang
Last synced: about 1 month ago
JSON representation
A minesweeper game built in Golang.
- Host: GitHub
- URL: https://github.com/pedrohenriques/go-minesweeper
- Owner: PedroHenriques
- License: mit
- Created: 2022-11-22T12:14:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-03T18:30:00.000Z (over 2 years ago)
- Last Synced: 2025-01-17T09:33:49.574Z (3 months ago)
- Topics: fyne, golang
- Language: Go
- Homepage:
- Size: 96.7 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://coveralls.io/github/PedroHenriques/go-minesweeper?branch=main)

# 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](http://pedrojhenriques.com/games/go-minesweeper/)
## Building the binaries
### Prerequisites
- **Docker:** Install documentation [here](https://docs.docker.com/get-docker/)
### Building the binaries
On a terminal, from the root of the repo, run
```sh
sh cli/build.sh [OPTIONS]Options:
-b, --build: will build the docker image used to compile the code
--version: version of the build. Will be used to name the binary file.
```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's dependencies for your OS. Consult them [here](https://developer.fyne.io/started/#prerequisites)
### Running the game
On a terminal, from the root of the repo, run
```sh
go run ./main.go
```## Development tools
### Updating the asset bundle file
On a terminal, from the root of the repo, run
```sh
sh cli/bundle.sh
```The script will catch all files inside `assets/images/`
### Running the linters
On a terminal, from the root of the repo, run
```sh
sh cli/lint.sh [OPTIONS]Options:
-b, --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
sh cli/test.sh [OPTIONS] [dir1 dir2 ...]Options:
-b, --build: will build the docker image used to run the tests
-w, --watch: run the tests in watch modedir1 dir2 ...: the directories to look for test files. Defaults to all subdirectories of internal/
```### Running the test coverage
On a terminal, from the root of the repo, run
```sh
sh cli/coverage.sh [OPTIONS]Options:
-b, --build: will build the docker image used to run the tests
```The output will be available on the directory `coverage/`