return ret;
}
+int endofgame (board_t *board)
+{
+ return ((strchr (board->tab, '.') == NULL) && (strchr (board->tab, '*') == NULL));
+}
+
/* vim: set ts=4 sw=4 et: */
int findchar (board_t *board, char c, int *px, int *py);
+int endofgame (board_t *board);
+
#endif /* __FUNCTION_H__ */
/* vim: set ts=4 sw=4 et: */
spin = 1;
}
+ /* test end of game */
+ if (endofgame (board)) {
+ mode = 2;
+ sprintf (msg, "End of game");
+ msgwindow (msg, xboard + (board->width - strlen (msg)) / 2, yboard + (board->height - 1) / 2, strlen (msg), 1);
+ }
+
int ch = getch ();
/* record key pressed */
break;
}
+ if (mode == 2) {
+ continue;
+ }
+
/* game controls */
switch (ch) {
case KEY_UP: