mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Neat idea from Gareth: if you put a % on the end of the mine count
in the Custom dialog box, it'll treat it as a mine density. [originally from svn r5861]
This commit is contained in:
2
mines.c
2
mines.c
@ -232,6 +232,8 @@ static game_params *custom_params(config_item *cfg)
|
|||||||
ret->w = atoi(cfg[0].sval);
|
ret->w = atoi(cfg[0].sval);
|
||||||
ret->h = atoi(cfg[1].sval);
|
ret->h = atoi(cfg[1].sval);
|
||||||
ret->n = atoi(cfg[2].sval);
|
ret->n = atoi(cfg[2].sval);
|
||||||
|
if (strchr(cfg[2].sval, '%'))
|
||||||
|
ret->n = ret->n * (ret->w * ret->h) / 100;
|
||||||
ret->unique = cfg[3].ival;
|
ret->unique = cfg[3].ival;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
12
puzzles.but
12
puzzles.but
@ -891,7 +891,17 @@ menu are:
|
|||||||
|
|
||||||
\dt \e{Mines}
|
\dt \e{Mines}
|
||||||
|
|
||||||
\dd Number of mines in the grid.
|
\dd Number of mines in the grid. You can enter this as an absolute
|
||||||
|
mine count, or alternatively you can put a \cw{%} sign on the end in
|
||||||
|
which case the game will arrange for that proportion of the squares
|
||||||
|
in the grid to be mines.
|
||||||
|
|
||||||
|
\lcont{
|
||||||
|
|
||||||
|
Beware of setting the mine count too high. At very high densities,
|
||||||
|
the program may spend forever searching for a solvable grid.
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
\dt \e{Ensure solubility}
|
\dt \e{Ensure solubility}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user