4 ms·
How does he guarentee it?
by niuzeta 9y ago
How does he guarentee it?
- Doxin 9y agoNormally you'd do that by quickly reshuffling the mines if you guess wrong, although he might've gone the route of checking if it's possible to get into a guess-only state during generation and regenerating the board until no such states exist.
- tim_hutton 9y agoThe source code (mines.c) is here: https://git.tartarus.org/?p=simon/puzzles.git;a=blob;f=mines.c;h=da4428c7eb400620cf3ea114e598935b4a82d4ab;hb=HEAD https://git.tartarus.org/?p=simon/puzzles.git;a=blob;f=mines... There is code for solving a grid using deductions in this section: https://git.tartarus.org/?p=simon/puzzles.git;a=blob;f=mines.c;h=da4428c7eb400620cf3ea114e598935b4a82d4ab;hb=HEAD#l278 https://git.tartarus.org/?p=simon/puzzles.git;a=blob;f=mines... And below that is the code that generates grids and checks that they are solvable without taking risks. A similar approach is used to analyse the difficulty of Sudoku games here: http://hodoku.sourceforge.net/en/index.php http://hodoku.sourceforge.net/en/index.php with different names for the different types of deduction.
- niuzeta 9y agoThank you so much! This helps so much.