Skip to content

Commit 989bb74

Browse files
minesweeper: split into introduction and instructions
1 parent 381bb40 commit 989bb74

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

exercises/minesweeper/description.md

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

exercises/minesweeper/instructions.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 its number of adjacent mines (horizontally, vertically, diagonally).
7+
If the empty square has no adjacent mines, leave it empty, otherwise replace it with the adjacent mines count.
8+
9+
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+
11+
```text
12+
·*·*·
13+
··*··
14+
··*··
15+
·····
16+
```
17+
18+
Which your code should transform into this:
19+
20+
```text
21+
1*3*1
22+
13*31
23+
·2*2·
24+
·111·
25+
```

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)