5 ms·
As a next challenge, can you ensure the board is solvable without guessing? You have to delay generating it until the user has done that first click, but there
by aardvark179 8y ago
As a next challenge, can you ensure the board is solvable without guessing? You have to delay generating it until the user has done that first click, but there are some other constraints as well.
Also, you probably want to stop clicks on marked squares from exploding the mine.
- degenerate 8y agoI kept right-clicking to flag the mines and didn't understand what was happening. edit: [Shift] + Click to flag.
- lilactown 8y agoShift-click flags the mines according to the description
- sneakypeet 8y agoYeah shift click should do the trick
- sneakypeet 8y agooh yes. I did not think of that. generating on first click should not be to difficult. what are the other constraints?
- pbhjpbhj 8y agoNot parent: if you click a square and it says 7/6 then sometimes (next to a corner) you can only guess, you can't deduce the correct square to flag. There are others.
- aardvark179 8y agoYou can’t have enclosed areas that contain mines, there’s probably a few others. The easiest thing to do is to write a solver which will iteratively mark squares it knows to contain a mine, or knows don’t contain a mine. If the solver can find all the mines the board is solvable. Only present the user with boards that your solver can solve.
- simcop2387 8y agoA convinent source of information about this is going to be Simon Tatham's excellent puzzle suite. Most the puzzles are built to ensure a solution without guessing. https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/mines.html#mines https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/min... https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ They're all open source and I believe available on iOS as well as android for free for mobile users too.