Minor improvement to initial loop generation.

[originally from svn r6292]
This commit is contained in:
Simon Tatham
2005-09-11 18:05:23 +00:00
parent 6bbcf248aa
commit f71630073f

11
loopy.c
View File

@ -764,7 +764,16 @@ static char *new_fullyclued_board(game_params *params, random_state *rs)
square = (struct square *)index234(lightable_squares_sorted, 0); square = (struct square *)index234(lightable_squares_sorted, 0);
assert(square); assert(square);
if (square->score <= 0) /*
* We never want to _decrease_ the loop's perimeter. Making
* moves that leave the perimeter the same is occasionally
* useful: if it were _never_ done then the user would be
* able to deduce illicitly that any degree-zero vertex was
* on the outside of the loop. So we do it sometimes but
* not always.
*/
if (square->score < 0 || (square->score == 0 &&
random_upto(rs, 2) == 0))
break; break;
print_tree(lightable_squares_sorted); print_tree(lightable_squares_sorted);