X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=fifteen.c;h=3965844da94baf8909d90101d12a44cd84a2d7c5;hb=aa9a8e8c7eecc2de77690b872931e88951622813;hp=74fd4fc5970db564237d7a31e9d8ef601ab69b02;hpb=6e42ddd31b5ca71f48c6260b01fc49b2451d0a56;p=sgt-puzzles.git diff --git a/fifteen.c b/fifteen.c index 74fd4fc..3965844 100644 --- a/fifteen.c +++ b/fifteen.c @@ -131,7 +131,7 @@ int perm_parity(int *perm, int n) return ret; } -char *new_game_seed(game_params *params) +char *new_game_seed(game_params *params, random_state *rs) { int gap, n, i, x; int x1, x2, p1, p2, parity; @@ -149,7 +149,7 @@ char *new_game_seed(game_params *params) used[i] = FALSE; } - gap = rand_upto(n); + gap = random_upto(rs, n); tiles[gap] = 0; used[0] = TRUE; @@ -157,7 +157,7 @@ char *new_game_seed(game_params *params) * Place everything else except the last two tiles. */ for (x = 0, i = n-1; i > 2; i--) { - int k = rand_upto(i); + int k = random_upto(rs, i); int j; for (j = 0; j < n; j++)