X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=cube.c;h=ccc8689322849f3ec3c1d30083a45c2c7d9cee55;hb=aa9a8e8c7eecc2de77690b872931e88951622813;hp=6c2658f520431704947e3187b17ef41f9db90fc6;hpb=6e42ddd31b5ca71f48c6260b01fc49b2451d0a56;p=sgt-puzzles.git diff --git a/cube.c b/cube.c index 6c2658f..ccc8689 100644 --- a/cube.c +++ b/cube.c @@ -560,7 +560,7 @@ static void classify_grid_square_callback(void *ctx, struct grid_square *sq) data->squareindex++; } -char *new_game_seed(game_params *params) +char *new_game_seed(game_params *params, random_state *rs) { struct grid_data data; int i, j, k, m, area, facesperclass; @@ -605,7 +605,7 @@ char *new_game_seed(game_params *params) for (i = 0; i < data.nclasses; i++) { for (j = 0; j < facesperclass; j++) { - int n = rand_upto(data.nsquares[i]); + int n = random_upto(rs, data.nsquares[i]); assert(!flags[data.gridptrs[i][n]]); flags[data.gridptrs[i][n]] = TRUE; @@ -653,7 +653,7 @@ char *new_game_seed(game_params *params) /* * Choose a non-blue square for the polyhedron. */ - sprintf(p, ":%d", data.gridptrs[0][rand_upto(m)]); + sprintf(p, ":%d", data.gridptrs[0][random_upto(rs, m)]); sfree(data.gridptrs[0]); sfree(flags);