12
6
Similar to generating minesweeper grids, although the challenge is to make a working minesweeper grid. This will be longer code than normal (I think).
more information on minesweeper.
Minesweeper is a logic game found on most OS's. The goal of the game is to determine where the mines are on a grid, given numbers indicating the number of mines around that spot.
Required features:
-Randomized mine generation
-8x8 field with 10 mines
-Mine and "unknown" flags
-Reveal nearby blank spaces when a blank space has been revealed.
-Input and output code: It must be playable. (Input and output code counts in the total)
Note on scoring:
Anything that is needed to make the program work is counted.
If it can be deleted and not affect the program, get rid of it.
I will occasionally update the selected answer to shorter programs if needed.
I came across a more specific version of this problem in computer science class: make a working version with the shortest number of lines in visual basic (I got 57 lines), and I thought it will be an interesting challenge for code golf. If there are any suggestions for improving the question, please comment. Shortest code in bytes wins.
Do we need to allow for mine and "unknown" flags? Also, does UI code count towards the total? – Shmiddty – 2013-02-06T17:05:21.217
Also, I assume we're counting bytes instead of lines, since several languages could make this as a one-liner. – Shmiddty – 2013-02-06T17:12:54.117
Edited original post to clarify uncertainties. – EAKAE – 2013-02-06T20:09:07.120
I edited the title, cause I first thought you're looking for solutions in functional programming languages only. I renamed to 'working' instead of 'functional', while it is quiete normal, that we look for working solutions - what else? – user unknown – 2013-02-07T23:11:59.443