From 681d69b2edd6c9fd1b0a21eb5f0f02b9385cd31b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 17 Apr 2024 11:09:29 +0200 Subject: [PATCH 1/2] Sync the `minesweeper` exercise's docs with the latest data. --- .../minesweeper/.docs/instructions.md | 29 ++++++------------- .../minesweeper/.docs/introduction.md | 5 ++++ 2 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 exercises/practice/minesweeper/.docs/introduction.md diff --git a/exercises/practice/minesweeper/.docs/instructions.md b/exercises/practice/minesweeper/.docs/instructions.md index 1114cc95..7c1df2e4 100644 --- a/exercises/practice/minesweeper/.docs/instructions.md +++ b/exercises/practice/minesweeper/.docs/instructions.md @@ -1,35 +1,24 @@ # 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. +For example, you may receive a 5 x 4 board like this (empty spaces are represented here with the '·' character for display on screen): -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): - -``` +```text ·*·*· ··*·· ··*·· ····· ``` -And your code will transform it into this: +Which your code should transform into this: -``` +```text 1*3*1 13*31 ·2*2· diff --git a/exercises/practice/minesweeper/.docs/introduction.md b/exercises/practice/minesweeper/.docs/introduction.md new file mode 100644 index 00000000..5f74a742 --- /dev/null +++ b/exercises/practice/minesweeper/.docs/introduction.md @@ -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) From c97ae2ea9b811953d3a4214a4adbf08b700e25d6 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 17 Apr 2024 11:09:29 +0200 Subject: [PATCH 2/2] Sync the `minesweeper` exercise's metadata with the latest data. --- exercises/practice/minesweeper/.meta/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/minesweeper/.meta/config.json b/exercises/practice/minesweeper/.meta/config.json index 9649ef53..a1291a58 100644 --- a/exercises/practice/minesweeper/.meta/config.json +++ b/exercises/practice/minesweeper/.meta/config.json @@ -16,5 +16,5 @@ ".meta/uMineSweeperExample.pas" ] }, - "blurb": "Add the numbers to a minesweeper board" + "blurb": "Add the numbers to a minesweeper board." }