Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minesweeper: split into introduction and instructions #2421

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions exercises/minesweeper/description.md

This file was deleted.

25 changes: 25 additions & 0 deletions exercises/minesweeper/instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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 (`*`).

Check failure on line 4 in exercises/minesweeper/instructions.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Spaces inside code span elements

exercises/minesweeper/instructions.md:4:76 MD038/no-space-in-code Spaces inside code span elements [Context: "` `"] https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md038.md
ErikSchierboom marked this conversation as resolved.
Show resolved Hide resolved

For each empty square, count its number of adjacent mines (horizontally, vertically, diagonally).
ErikSchierboom marked this conversation as resolved.
Show resolved Hide resolved
If the empty square has no adjacent mines, leave it empty, otherwise replace it with the adjacent mines count.
ErikSchierboom marked this conversation as resolved.
Show resolved Hide resolved

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·
```
5 changes: 5 additions & 0 deletions exercises/minesweeper/introduction.md
ErikSchierboom marked this conversation as resolved.
Show resolved Hide resolved
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)
Loading