-
-
Notifications
You must be signed in to change notification settings - Fork 554
minesweeper: remove border #1602
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
Add the numbers to a minesweeper board. | ||
Add the mine counts to a completed Minesweeper board. | ||
|
||
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. | ||
|
||
In this exercise you have to create some code that counts the number of | ||
mines adjacent to a square and transforms boards like this (where `*` | ||
indicates a mine): | ||
|
||
+-----+ | ||
| * * | | ||
| * | | ||
| * | | ||
| | | ||
+-----+ | ||
|
||
into this: | ||
|
||
+-----+ | ||
|1*3*1| | ||
|13*31| | ||
| 2*2 | | ||
| 111 | | ||
+-----+ | ||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. regarding #1602 (comment) - I'd like to broach the possibility of writing this using backticks. How would that look? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could do backticks around quotes (ie At the end of the day these are markdown files. We need not — and cannot — fight to retain their readability in plaintext as a priority over their readability in a markdown enabled viewer, since that’s their primary means of consumption in the current environment. We could entertain putting a script in the toolchain somewhere that removes all markdown formatting from the generated README that the user downloads (ie README.md -> README.txt), but that would then have to be distinct from the one that’s rendered on the website. |
||
|
||
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): | ||
|
||
``` | ||
·*·*· | ||
··*·· | ||
··*·· | ||
····· | ||
``` | ||
|
||
And your code will transform it into this: | ||
|
||
``` | ||
1*3*1 | ||
13*31 | ||
·2*2· | ||
·111· | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.