-static char *interpret_move(game_state *state, game_ui *ui, const game_drawstate *ds,
- int x, int y, int button)
+static int is_clue(const game_state *state, int x, int y)
+{
+ int h = state->h, w = state->w;
+
+ if (((x == -1 || x == w) && y >= 0 && y < h) ||
+ ((y == -1 || y == h) && x >= 0 && x < w))
+ return TRUE;
+
+ return FALSE;
+}
+
+static int clue_index(const game_state *state, int x, int y)
+{
+ int h = state->h, w = state->w;
+
+ if (y == -1)
+ return x;
+ else if (x == w)
+ return w + y;
+ else if (y == h)
+ return 2 * w + h - x - 1;
+ else if (x == -1)
+ return 2 * (w + h) - y - 1;
+
+ return -1;
+}
+
+static char *interpret_move(const game_state *state, game_ui *ui,
+ const game_drawstate *ds,
+ int x, int y, int button)