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]
This commit is contained in:
Jacob Nevins
2004-12-22 19:27:26 +00:00
parent ec3d23c9d9
commit 46fa25240e
6 changed files with 109 additions and 42 deletions

View File

@ -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);