Add option to set random seed for deterministic behavior

Bump version to 1.6
This commit is contained in:
2022-01-15 14:40:21 -05:00
parent 476aa4bce6
commit 0272fd726d
10 changed files with 58 additions and 12 deletions

View File

@@ -10,6 +10,8 @@ mazeoptions_t* mazemaker_options_new() {
// set defaults
memset(result->wall_color, 0, 3);
memset(result->background_color, 0xff, 3);
result->seed = 0;
result->seed_set = false;
return result;
}
@@ -78,3 +80,7 @@ int mazemaker_options_set_background_color(mazeoptions_t* options, char const* c
return stringToColor(color_desc, options->background_color);
}
void mazemaker_options_set_seed(mazeoptions_t* options, rand_seed_t seed) {
options->seed = seed;
options->seed_set = true;
}