~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce a new game backend function (there seem to have been a lot
[sgt/puzzles]
/
net.c
diff --git
a/net.c
b/net.c
index
33af6c6
..
fe9b846
100644
(file)
--- a/
net.c
+++ b/
net.c
@@
-1229,7
+1229,7
@@
static char *new_game_desc(game_params *params, random_state *rs,
OFFSET(x2, y2, x1, y1, d1, params);
d2 = F(d1);
OFFSET(x2, y2, x1, y1, d1, params);
d2 = F(d1);
-#ifdef
DEBUG
+#ifdef
GENERATION_DIAGNOSTICS
printf("picked (%d,%d,%c) <-> (%d,%d,%c)\n",
x1, y1, "0RU3L567D9abcdef"[d1], x2, y2, "0RU3L567D9abcdef"[d2]);
#endif
printf("picked (%d,%d,%c) <-> (%d,%d,%c)\n",
x1, y1, "0RU3L567D9abcdef"[d1], x2, y2, "0RU3L567D9abcdef"[d2]);
#endif
@@
-1256,7
+1256,7
@@
static char *new_game_desc(game_params *params, random_state *rs,
xydp = find234(possibilities, &xyd1, NULL);
if (xydp) {
xydp = find234(possibilities, &xyd1, NULL);
if (xydp) {
-#ifdef
DEBUG
+#ifdef
GENERATION_DIAGNOSTICS
printf("T-piece; removing (%d,%d,%c)\n",
xydp->x, xydp->y, "0RU3L567D9abcdef"[xydp->direction]);
#endif
printf("T-piece; removing (%d,%d,%c)\n",
xydp->x, xydp->y, "0RU3L567D9abcdef"[xydp->direction]);
#endif
@@
-1283,7
+1283,7
@@
static char *new_game_desc(game_params *params, random_state *rs,
xydp = find234(possibilities, &xyd1, NULL);
if (xydp) {
xydp = find234(possibilities, &xyd1, NULL);
if (xydp) {
-#ifdef
DEBUG
+#ifdef
GENERATION_DIAGNOSTICS
printf("Loop avoidance; removing (%d,%d,%c)\n",
xydp->x, xydp->y, "0RU3L567D9abcdef"[xydp->direction]);
#endif
printf("Loop avoidance; removing (%d,%d,%c)\n",
xydp->x, xydp->y, "0RU3L567D9abcdef"[xydp->direction]);
#endif
@@
-1318,7
+1318,7
@@
static char *new_game_desc(game_params *params, random_state *rs,
if (index(params, tiles, x3, y3))
continue; /* this would create a loop */
if (index(params, tiles, x3, y3))
continue; /* this would create a loop */
-#ifdef
DEBUG
+#ifdef
GENERATION_DIAGNOSTICS
printf("New frontier; adding (%d,%d,%c)\n",
x2, y2, "0RU3L567D9abcdef"[d]);
#endif
printf("New frontier; adding (%d,%d,%c)\n",
x2, y2, "0RU3L567D9abcdef"[d]);
#endif
@@
-1786,6
+1786,11
@@
static void free_ui(game_ui *ui)
sfree(ui);
}
sfree(ui);
}
+static void game_changed_state(game_ui *ui, game_state *oldstate,
+ game_state *newstate)
+{
+}
+
/* ----------------------------------------------------------------------
* Process a move.
*/
/* ----------------------------------------------------------------------
* Process a move.
*/
@@
-2591,6
+2596,7
@@
const struct game thegame = {
FALSE, game_text_format,
new_ui,
free_ui,
FALSE, game_text_format,
new_ui,
free_ui,
+ game_changed_state,
make_move,
game_size,
game_colours,
make_move,
game_size,
game_colours,