Make fill proportion a parameter to gen()
This commit is contained in:
8
main.c
8
main.c
@@ -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 =======");
|
||||
|
||||
Reference in New Issue
Block a user