https://github.com/rcdmk/go-mine-sweeper
A Golang command-line implementation of the classic mine sweeper game
https://github.com/rcdmk/go-mine-sweeper
command-line game game-development
Last synced: 10 months ago
JSON representation
A Golang command-line implementation of the classic mine sweeper game
- Host: GitHub
- URL: https://github.com/rcdmk/go-mine-sweeper
- Owner: rcdmk
- Created: 2023-10-19T22:03:05.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-20T22:25:54.000Z (over 2 years ago)
- Last Synced: 2024-06-20T22:27:08.632Z (almost 2 years ago)
- Topics: command-line, game, game-development
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-mine-sweeper
A command-line implementation of the famous mine sweeper game.
```
* MINE SWEEPER * * MINE SWEEPER *
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
1 [1 - - - - - - - - -] 1 [- - - * - - - * - -]
2 [- - - - - - - - - -] 2 [* - - - - * - - - -]
3 [- - - - - - - - - -] 3 [- - * - - - - - * -]
4 [ - - - - - - - - -] 4 [- - - - - - - - - -]
5 [ - - - - - -] 5 [- - - - - * - * * -]
6 [ - - - - - -] 6 [- - - - - - - - - -]
7 [ ] 7 [- - - - - - - - - -]
8 [ - - - ] 8 [- - - - - - - - - -]
9 [ - - - ] 9 [- - * - - - - - - -]
10 [ - - - ] 10 [- - - - - - - - - -]
Enter X coordinate [1 - 10]: 2 GAME OVER!
Hit mine at (X 3, Y 9)
```
## Run
```sh
go run .
# or
go build && ./go-mine-sweeper
```
## How to play
The goal of the game is to reveal all cells that don't contain a mine.
To reveal a cell, enter coordinates for X and Y (1 based).
If a mine is revealed, game is over and you lose.
If an empty cell is revealed, all adjacent empty cells are revealed automatically.
Mines are surrounded by cells which contain the number of mines that are adjacento them (eg. if a cell has 3 mines adjacent to it, it will contain the number 3). Use this information to pick the right cells.