Hacker News new | past | comments | ask | show | jobs | submit login

oh yes. I did not think of that. generating on first click should not be to difficult. what are the other constraints?



A 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/min...

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.


You 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.


Not 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: