https://github.com/j-p-d-e-v/exercism-minesweeper
A rust exercise from Exercism
https://github.com/j-p-d-e-v/exercism-minesweeper
coding exercism rust rustprogramming
Last synced: 11 months ago
JSON representation
A rust exercise from Exercism
- Host: GitHub
- URL: https://github.com/j-p-d-e-v/exercism-minesweeper
- Owner: j-p-d-e-v
- Created: 2024-03-16T20:18:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T23:45:13.000Z (about 2 years ago)
- Last Synced: 2025-06-12T07:12:37.963Z (12 months ago)
- Topics: coding, exercism, rust, rustprogramming
- Language: Rust
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EXERCISM: MINESWEEPER
# Instructions
Add the mine counts to a completed Minesweeper board.
Minesweeper is a popular game where the user has to find the mines using numeric hints that indicate how many mines are directly adjacent (horizontally, vertically, diagonally) to a square.
In this exercise you have to create some code that counts the number of mines adjacent to a given empty square and replaces that square with the count.
The board is a rectangle composed of blank space (' ') characters.
A mine is represented by an asterisk (`*`) character.
If a given space has no adjacent mines at all, leave that square blank.
## Examples
For example you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen):
```text
·*·*·
··*··
··*··
·····
```
And your code will transform it into this:
```text
1*3*1
13*31
·2*2·
·111·
```
Reference: https://exercism.org/tracks/rust/exercises/minesweeper