Make fill proportion a parameter to gen()

This commit is contained in:
2022-11-23 17:56:12 +00:00
parent 71db045c9f
commit 37e7c6481a
3 changed files with 11 additions and 11 deletions

8
main.c
View File

@@ -48,7 +48,9 @@ static uint32_t getseed(void)
return seed;
}
static void genpuzzles(struct sudoku puzzles_out[NPUZZLES], bool print_progress)
static void genpuzzles(struct sudoku puzzles_out[NPUZZLES],
double fill_prop,
bool print_progress)
{
unsigned i, j, bslen = 0;
@@ -63,7 +65,7 @@ static void genpuzzles(struct sudoku puzzles_out[NPUZZLES], bool print_progress)
fflush(stdout);
}
gen(&puzzles_out[i]);
gen(&puzzles_out[i], fill_prop);
}
if (print_progress) {
@@ -118,7 +120,7 @@ int main(void)
srand(seed);
struct sudoku puzzles[NPUZZLES];
genpuzzles(puzzles, true);
genpuzzles(puzzles, 0.33, true);
struct bench_res res = runbench(puzzles);
puts("\n SUMMARY\n =======");