Skip to content

Commit f003c8e

Browse files
Sync the minesweeper exercise's docs with the latest data. (#2778)
1 parent 168ca1d commit f003c8e

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

exercises/practice/minesweeper/.docs/instructions.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
# Instructions
22

3-
Add the mine counts to a completed Minesweeper board.
3+
Your task is to add the mine counts to empty squares in a completed Minesweeper board.
4+
The board itself is a rectangle composed of squares that are either empty (`' '`) or a mine (`'*'`).
45

5-
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.
6+
For each empty square, count the number of mines adjacent to it (horizontally, vertically, diagonally).
7+
If the empty square has no adjacent mines, leave it empty.
8+
Otherwise replace it with the adjacent mines count.
69

7-
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.
8-
9-
The board is a rectangle composed of blank space (' ') characters.
10-
A mine is represented by an asterisk (`*`) character.
11-
12-
If a given space has no adjacent mines at all, leave that square blank.
13-
14-
## Examples
15-
16-
For example you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen):
10+
For example, you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen):
1711

1812
```text
1913
·*·*·
@@ -22,7 +16,7 @@ For example you may receive a 5 x 4 board like this (empty spaces are represente
2216
·····
2317
```
2418

25-
And your code will transform it into this:
19+
Which your code should transform into this:
2620

2721
```text
2822
1*3*1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Introduction
2+
3+
[Minesweeper][wikipedia] 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.
4+
5+
[wikipedia]: https://en.wikipedia.org/wiki/Minesweeper_(video_game)

0 commit comments

Comments
 (0)