diff options
| -rw-r--r-- | blackbox.c | 22 | ||||
| -rw-r--r-- | bridges.c | 6 | ||||
| -rw-r--r-- | cube.c | 6 | ||||
| -rw-r--r-- | devel.but | 53 | ||||
| -rw-r--r-- | dominosa.c | 6 | ||||
| -rw-r--r-- | fifteen.c | 6 | ||||
| -rw-r--r-- | filling.c | 6 | ||||
| -rw-r--r-- | flip.c | 6 | ||||
| -rw-r--r-- | galaxies.c | 6 | ||||
| -rw-r--r-- | guess.c | 23 | ||||
| -rw-r--r-- | inertia.c | 12 | ||||
| -rw-r--r-- | keen.c | 6 | ||||
| -rw-r--r-- | lightup.c | 6 | ||||
| -rw-r--r-- | loopy.c | 6 | ||||
| -rw-r--r-- | magnets.c | 6 | ||||
| -rw-r--r-- | map.c | 6 | ||||
| -rw-r--r-- | midend.c | 8 | ||||
| -rw-r--r-- | mines.c | 11 | ||||
| -rw-r--r-- | net.c | 6 | ||||
| -rw-r--r-- | netslide.c | 6 | ||||
| -rw-r--r-- | nullgame.c | 6 | ||||
| -rw-r--r-- | pattern.c | 6 | ||||
| -rw-r--r-- | pegs.c | 10 | ||||
| -rw-r--r-- | puzzles.h | 4 | ||||
| -rw-r--r-- | range.c | 6 | ||||
| -rw-r--r-- | rect.c | 6 | ||||
| -rw-r--r-- | samegame.c | 11 | ||||
| -rw-r--r-- | signpost.c | 6 | ||||
| -rw-r--r-- | singles.c | 6 | ||||
| -rw-r--r-- | sixteen.c | 6 | ||||
| -rw-r--r-- | slant.c | 6 | ||||
| -rw-r--r-- | solo.c | 6 | ||||
| -rw-r--r-- | tents.c | 6 | ||||
| -rw-r--r-- | towers.c | 6 | ||||
| -rw-r--r-- | twiddle.c | 6 | ||||
| -rw-r--r-- | unequal.c | 6 | ||||
| -rw-r--r-- | unfinished/group.c | 6 | ||||
| -rw-r--r-- | unfinished/pearl.c | 6 | ||||
| -rw-r--r-- | unfinished/separate.c | 6 | ||||
| -rw-r--r-- | unfinished/slide.c | 6 | ||||
| -rw-r--r-- | unfinished/sokoban.c | 6 | ||||
| -rw-r--r-- | untangle.c | 6 |
42 files changed, 188 insertions, 164 deletions
@@ -1462,13 +1462,21 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - /* - * We return true whenever the solution has been revealed, even - * (on spoiler grounds) if it wasn't guessed correctly. - */ - return state->reveal; + if (state->reveal) { + /* + * We return nonzero whenever the solution has been revealed, + * even (on spoiler grounds) if it wasn't guessed correctly. + */ + if (state->nwrong == 0 && + state->nmissed == 0 && + state->nright >= state->minballs) + return +1; + else + return -1; + } + return 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1519,7 +1527,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2713,9 +2713,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2821,7 +2821,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1708,9 +1708,9 @@ static float game_flash_length(game_state *oldstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1761,7 +1761,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1224,27 +1224,33 @@ a mine from the colour it uses when you complete the game. In order to achieve this, its \cw{flash_length()} function has to store a flag in the \c{game_ui} to indicate which flash type is required.) -\S{backend-is-solved} \cw{is_solved()} +\S{backend-status} \cw{status()} -\c int (*is_solved)(game_state *state); +\c int (*status)(game_state *state); -This function returns \cw{TRUE} if the game represented by \cw{state} -is currently in a solved state. The mid-end uses this to implement -\cw{midend_is_solved()} (\k{midend-is-solved}). +This function returns a status value indicating whether the current +game is still in play, or has been won, or has been conclusively lost. +The mid-end uses this to implement \cw{midend_status()} +(\k{midend-status}). -Front ends may wish to use this as a cue to proactively offer the -option of starting a new game. Therefore, back ends should consider -returning \cw{TRUE} in situations where the game is \e{lost} as well -as won, if losing makes it unlikely that the player would play on. +The return value should be +1 if the game has been successfully +solved. If the game has been lost in a situation where further play is +unlikely, the return value should be -1. If neither is true (so play +is still ongoing), return zero. + +Front ends may wish to use a non-zero status as a cue to proactively +offer the option of starting a new game. Therefore, back ends should +not return -1 if the game has been \e{technically} lost but undoing +and continuing is still a realistic possibility. (For instance, games with hidden information such as Guess or Mines -might well set this flag whenever they reveal the solution, whether or -not the player guessed it correctly, on the grounds that a player -would be unlikely to hide the solution and continue playing after the -answer was spoiled. On the other hand, games where you can merely get -into a dead end such as Same Game or Inertia might choose not to, on -the grounds that the player would quite likely press Undo and carry on -playing.) +might well return a non-zero status whenever they reveal the solution, +whether or not the player guessed it correctly, on the grounds that a +player would be unlikely to hide the solution and continue playing +after the answer was spoiled. On the other hand, games where you can +merely get into a dead end such as Same Game or Inertia might choose +to return 0 in that situation, on the grounds that the player would +quite likely press Undo and carry on playing.) \S{backend-redraw} \cw{redraw()} @@ -3118,18 +3124,19 @@ The front end can expect its drawing API and/or \cw{activate_timer()} to be called from within a call to this function. -\H{midend-is-solved} \cw{midend_is_solved()} +\H{midend-status} \cw{midend_status()} -\c int midend_is_solved(midend *me); +\c int midend_status(midend *me); -This function returns \cw{TRUE} if the midend is currently displaying -a game in a solved state, according to the back end's \cw{is_solved()} +This function returns +1 if the midend is currently displaying a game +in a solved state, -1 if the game is in a permanently lost state, or 0 +otherwise. This function just calls the back end's \cw{status()} function. Front ends may wish to use this as a cue to proactively offer the option of starting a new game. -(See \k{backend-is-solved} for more detail about the back end's -\cw{is_solved()} function and discussion of what should count as -\q{solved} anyway). +(See \k{backend-status} for more detail about the back end's +\cw{status()} function and discussion of what should count as which +status code.) \H{midend-can-undo} \cw{midend_can_undo()} @@ -1535,9 +1535,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1628,7 +1628,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -830,9 +830,9 @@ static float game_flash_length(game_state *oldstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -883,7 +883,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1617,9 +1617,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1720,7 +1720,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1251,9 +1251,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1304,7 +1304,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -3348,9 +3348,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -3573,7 +3573,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, #ifdef EDITOR FALSE, FALSE, NULL, NULL, TRUE, /* wants_statusbar */ @@ -43,7 +43,7 @@ struct game_state { pegrow solution; int next_go; /* from 0 to nguesses-1; if next_go == nguesses then they've lost. */ - int solved; + int solved; /* +1 = win, -1 = lose, 0 = still playing */ }; static game_params *default_params(void) @@ -790,7 +790,7 @@ static game_state *execute_move(game_state *from, char *move) if (!strcmp(move, "S")) { ret = dup_game(from); - ret->solved = 1; + ret->solved = -1; return ret; } else if (move[0] == 'G') { p = move+1; @@ -817,11 +817,11 @@ static game_state *execute_move(game_state *from, char *move) nc_place = mark_pegs(ret->guesses[from->next_go], ret->solution, ret->params.ncolours); if (nc_place == ret->solution->npegs) { - ret->solved = 1; /* win! */ + ret->solved = +1; /* win! */ } else { ret->next_go = from->next_go + 1; if (ret->next_go >= ret->params.nguesses) - ret->solved = 1; /* 'lose' so we show the pegs. */ + ret->solved = -1; /* lose, meaning we show the pegs. */ } return ret; @@ -1273,7 +1273,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate, currmove_redraw(dr, ds, state->next_go, COL_HOLD); /* draw the solution (or the big rectangle) */ - if ((state->solved != ds->solved) || !ds->started) { + if ((!state->solved ^ !ds->solved) || !ds->started) { draw_rect(dr, SOLN_OX, SOLN_OY, SOLN_W, SOLN_H, state->solved ? COL_BACKGROUND : COL_EMPTY); draw_update(dr, SOLN_OX, SOLN_OY, SOLN_W, SOLN_H); @@ -1313,14 +1313,13 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { /* - * We return true whenever the solution has been revealed, even - * (on spoiler grounds) if it wasn't guessed correctly. - * - * However, in that situation, 'solved' is still true, so we don't - * have to make any effort to arrange this. + * We return nonzero whenever the solution has been revealed, even + * (on spoiler grounds) if it wasn't guessed correctly. The + * correct return value from this function is already in + * state->solved. */ return state->solved; } @@ -1373,7 +1372,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2135,14 +2135,14 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { /* - * If the player has died, we don't list the game as solved, - * because they're more likely to undo and carry on than to give - * up and start a new game. + * We never report the game as lost, on the grounds that if the + * player has died they're quite likely to want to undo and carry + * on. */ - return !state->gems; + return state->gems == 0 ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2193,7 +2193,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2005,9 +2005,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2286,7 +2286,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2160,9 +2160,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2267,7 +2267,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -3780,9 +3780,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->solved; + return state->solved ? +1 : 0; } static void game_print_size(game_params *params, float *x, float *y) @@ -3918,7 +3918,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE /* wants_statusbar */, FALSE, game_timing_state, @@ -2233,9 +2233,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2373,7 +2373,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -3025,9 +3025,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -3223,7 +3223,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, TRUE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1336,7 +1336,7 @@ char *midend_solve(midend *me) return NULL; } -int midend_is_solved(midend *me) +int midend_status(midend *me) { /* * We should probably never be called when the state stack has no @@ -1347,8 +1347,10 @@ int midend_is_solved(midend *me) * practically, a user whose midend has been left in that state * probably _does_ want the 'new game' option to be prominent. */ - return (me->statepos == 0 || - me->ourgame->is_solved(me->states[me->statepos-1].state)); + if (me->statepos == 0) + return +1; + + return me->ourgame->status(me->states[me->statepos-1].state); } char *midend_rewrite_statusbar(midend *me, char *text) @@ -3084,9 +3084,14 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->won; + /* + * We report the game as lost only if the player has used the + * Solve function to reveal all the mines. Otherwise, we assume + * they'll undo and continue play. + */ + return state->won ? (state->used_solve ? -1 : +1) : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -3139,7 +3144,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ TRUE, game_timing_state, @@ -2864,9 +2864,9 @@ static float game_flash_length(game_state *oldstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -3044,7 +3044,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1826,9 +1826,9 @@ static float game_flash_length(game_state *oldstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1879,7 +1879,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -238,9 +238,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return FALSE; + return 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -291,7 +291,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1282,9 +1282,9 @@ static float game_flash_length(game_state *oldstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1391,7 +1391,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1269,9 +1269,13 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + /* + * Dead-end situations are assumed to be rescuable by Undo, so we + * don't bother to identify them and return -1. + */ + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1322,7 +1326,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -253,7 +253,7 @@ char *midend_get_game_id(midend *me); int midend_can_format_as_text_now(midend *me); char *midend_text_format(midend *me); char *midend_solve(midend *me); -int midend_is_solved(midend *me); +int midend_status(midend *me); int midend_can_undo(midend *me); int midend_can_redo(midend *me); void midend_supersede_game_desc(midend *me, char *desc, char *privdesc); @@ -479,7 +479,7 @@ struct game { game_ui *ui); float (*flash_length)(game_state *oldstate, game_state *newstate, int dir, game_ui *ui); - int (*is_solved)(game_state *state); + int (*status)(game_state *state); int can_print, can_print_in_colour; void (*print_size)(game_params *params, float *x, float *y); void (*print)(drawing *dr, game_state *state, int tilesize); @@ -1485,9 +1485,9 @@ static float game_flash_length(game_state *from, game_state *to, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->was_solved; + return state->was_solved ? +1 : 0; } /* ---------------------------------------------------------------------- @@ -1737,7 +1737,7 @@ struct game const thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2855,9 +2855,9 @@ static float game_flash_length(game_state *oldstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2965,7 +2965,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1611,14 +1611,13 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { /* - * If the player has run out of moves without winning, we don't - * list the game as solved, because they're more likely to undo - * and carry on than to give up and start a new game. + * Dead-end situations are assumed to be rescuable by Undo, so we + * don't bother to identify them and return -1. */ - return state->complete; + return state->complete ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1669,7 +1668,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2122,9 +2122,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2208,7 +2208,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1735,9 +1735,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1826,7 +1826,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1073,9 +1073,9 @@ static float game_flash_length(game_state *oldstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1126,7 +1126,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2079,9 +2079,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2195,7 +2195,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -5187,9 +5187,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -5511,7 +5511,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -2522,9 +2522,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2597,7 +2597,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1808,9 +1808,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1932,7 +1932,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1069,9 +1069,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate, @@ -1291,7 +1291,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1865,9 +1865,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1958,7 +1958,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, diff --git a/unfinished/group.c b/unfinished/group.c index 869ff04..79bd3fa 100644 --- a/unfinished/group.c +++ b/unfinished/group.c @@ -1813,9 +1813,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1936,7 +1936,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, TRUE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, diff --git a/unfinished/pearl.c b/unfinished/pearl.c index 843d99e..51b2ed2 100644 --- a/unfinished/pearl.c +++ b/unfinished/pearl.c @@ -1349,9 +1349,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return FALSE; + return 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1402,7 +1402,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, diff --git a/unfinished/separate.c b/unfinished/separate.c index b11f604..b20cb52 100644 --- a/unfinished/separate.c +++ b/unfinished/separate.c @@ -795,9 +795,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return FALSE; + return 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -848,7 +848,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, diff --git a/unfinished/slide.c b/unfinished/slide.c index fbaa630..6fac469 100644 --- a/unfinished/slide.c +++ b/unfinished/slide.c @@ -2292,9 +2292,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -2345,7 +2345,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, TRUE, /* wants_statusbar */ FALSE, game_timing_state, diff --git a/unfinished/sokoban.c b/unfinished/sokoban.c index b389eb5..53bd3a5 100644 --- a/unfinished/sokoban.c +++ b/unfinished/sokoban.c @@ -1415,9 +1415,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1468,7 +1468,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, @@ -1412,9 +1412,9 @@ static float game_flash_length(game_state *oldstate, game_state *newstate, return 0.0F; } -static int game_is_solved(game_state *state) +static int game_status(game_state *state) { - return state->completed; + return state->completed ? +1 : 0; } static int game_timing_state(game_state *state, game_ui *ui) @@ -1465,7 +1465,7 @@ const struct game thegame = { game_redraw, game_anim_length, game_flash_length, - game_is_solved, + game_status, FALSE, FALSE, game_print_size, game_print, FALSE, /* wants_statusbar */ FALSE, game_timing_state, |