Skip to content

Commit

Permalink
Sync the minesweeper exercise's docs with the latest data. (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Apr 17, 2024
1 parent 4134ea1 commit 63c1682
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
20 changes: 7 additions & 13 deletions exercises/practice/minesweeper/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
# Instructions

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

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

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):
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
·*·*·
Expand All @@ -22,7 +16,7 @@ For example you may receive a 5 x 4 board like this (empty spaces are represente
·····
```

And your code will transform it into this:
Which your code should transform into this:

```text
1*3*1
Expand Down
5 changes: 5 additions & 0 deletions exercises/practice/minesweeper/.docs/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Introduction

[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.

[wikipedia]: https://en.wikipedia.org/wiki/Minesweeper_(video_game)

0 comments on commit 63c1682

Please sign in to comment.