diff options
| author | Franklin Wei <git@fwei.tk> | 2018-04-17 18:18:40 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2018-04-17 18:20:12 -0400 |
| commit | 6dc9d1d7309613fdc0518c03b2cdf3253d4c52fd (patch) | |
| tree | f6c9abf4a05f640134aa3d248a9498a06f596712 /apps/plugins/puzzles/src/unequal.c | |
| parent | 7a12e796a62b916dae5de1b2986e8cb11ac5be4c (diff) | |
| download | rockbox-6dc9d1d7309613fdc0518c03b2cdf3253d4c52fd.zip rockbox-6dc9d1d7309613fdc0518c03b2cdf3253d4c52fd.tar.gz rockbox-6dc9d1d7309613fdc0518c03b2cdf3253d4c52fd.tar.bz2 rockbox-6dc9d1d7309613fdc0518c03b2cdf3253d4c52fd.tar.xz | |
puzzles: enable all the remaining games
They all work now :). I merged in part of Chris Boyle's Android port of
Puzzles to give the front end a way to know what keys the back end needs.
This also re-syncs to the latest upstream sources.
Change-Id: Ie0409bbb32f617ae5abf4f81be3b45d1552db9bb
Diffstat (limited to 'apps/plugins/puzzles/src/unequal.c')
| -rw-r--r-- | apps/plugins/puzzles/src/unequal.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/unequal.c b/apps/plugins/puzzles/src/unequal.c index cb477c9..d8204a4 100644 --- a/apps/plugins/puzzles/src/unequal.c +++ b/apps/plugins/puzzles/src/unequal.c @@ -1280,6 +1280,21 @@ fail: return NULL; } +static char *game_request_keys(const game_params *params) +{ + int order = params->order; + char off = (order > 9) ? '0' : '1'; + char *keys = smalloc(order + 2); + int i; + for(i = 0; i < order; i++) { + if (i==10) off = 'a'-10; + keys[i] = i + off; + } + keys[order] = '\b'; + keys[order+1] = '\0'; + return keys; +} + static game_state *new_game(midend *me, const game_params *params, const char *desc) { @@ -2011,6 +2026,7 @@ const struct game thegame = { free_ui, encode_ui, decode_ui, + game_request_keys, game_changed_state, interpret_move, execute_move, |