-
-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minesweeper: split into introduction and instructions (#2421)
Split description into introduction and instructions documents. Co-authored-by: Isaac Good <[email protected]> --------- Co-authored-by: Isaac Good <[email protected]>
- Loading branch information
1 parent
509729f
commit 74e4087
Showing
3 changed files
with
31 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Instructions | ||
|
||
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 (`'*'`). | ||
|
||
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. | ||
|
||
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 | ||
·*·*· | ||
··*·· | ||
··*·· | ||
····· | ||
``` | ||
|
||
Which your code should transform into this: | ||
|
||
```text | ||
1*3*1 | ||
13*31 | ||
·2*2· | ||
·111· | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |