diff options
| author | Jacob Nevins <jacobn@chiark.greenend.org.uk> | 2004-12-22 19:27:26 +0000 |
|---|---|---|
| committer | Jacob Nevins <jacobn@chiark.greenend.org.uk> | 2004-12-22 19:27:26 +0000 |
| commit | 46fa25240e2e1609c4431a639f6e9c4bb6f50b39 (patch) | |
| tree | cee90db397ae7ddefe8c1aa3466e070c058aa272 /windows.c | |
| parent | ec3d23c9d99e5233d40080623c032dfe157d29ac (diff) | |
| download | puzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.zip puzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.tar.gz puzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.tar.bz2 puzzles-46fa25240e2e1609c4431a639f6e9c4bb6f50b39.tar.xz | |
Add a `jumble' key (`J') to Net, which scrambles the positions of all unlocked
tiles randomly. (Rachel asked for this; it's been being tested for a good few
months now, and Simon didn't care either way, so in it goes :)
As part of this, the front end can now be asked to provide a random random
seed (IYSWIM).
[originally from svn r5019]
Diffstat (limited to 'windows.c')
| -rw-r--r-- | windows.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -121,6 +121,14 @@ void fatal(char *fmt, ...) exit(1); } +void get_random_seed(void **randseed, int *randseedsize) +{ + time_t *tp = snew(time_t); + time(tp); + *randseed = (void *)tp; + *randseedsize = sizeof(time_t); +} + void status_bar(frontend *fe, char *text) { SetWindowText(fe->statusbar, text); @@ -352,12 +360,10 @@ static frontend *new_window(HINSTANCE inst, char *game_id, char **error) int x, y; RECT r, sr; HDC hdc; - time_t t; fe = snew(frontend); - time(&t); - fe->me = midend_new(fe, &t, sizeof(t)); + fe->me = midend_new(fe); if (game_id) { *error = midend_game_id(fe->me, game_id, FALSE); |