Skip to content

Commit 74e4087

Browse files
minesweeper: split into introduction and instructions (#2421)
Split description into introduction and instructions documents. Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com> --------- Co-authored-by: Isaac Good <IsaacG@users.noreply.github.com>
1 parent 509729f commit 74e4087

File tree

3 files changed

+31
-32
lines changed

3 files changed

+31
-32
lines changed

exercises/minesweeper/description.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

exercises/minesweeper/instructions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Instructions
2+
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 (`'*'`).
5+
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.
9+
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):
11+
12+
```text
13+
·*·*·
14+
··*··
15+
··*··
16+
·····
17+
```
18+
19+
Which your code should transform into this:
20+
21+
```text
22+
1*3*1
23+
13*31
24+
·2*2·
25+
·111·
26+
```

exercises/minesweeper/introduction.md

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)