when choording on an open cell, which has exactly the amount of closed
cells around it as it has mines next to it, flag all of them.
this is inspired by Lucas Nunes' Antimine.
return ((l2 == l) && (c2 == c));
}
return ((l2 == l) && (c2 == c));
}
+void flagall_square (int line, int col) {
+ AROUND(line,col)
+ if (AR_CELL.f != FLAG) {
+ flag_square(ROW, COL);
+ }
+}
+
int choord_square (int line, int col) {
AROUND(line,col)
if (AR_CELL.f != FLAG) {
int choord_square (int line, int col) {
AROUND(line,col)
if (AR_CELL.f != FLAG) {
if (uncover_square (g.p[0], g.p[1])) return GAME_LOST;
} else if (get_neighbours (g.p[0], g.p[1], 1) == 0) {
if (choord_square (g.p[0], g.p[1])) return GAME_LOST;
if (uncover_square (g.p[0], g.p[1])) return GAME_LOST;
} else if (get_neighbours (g.p[0], g.p[1], 1) == 0) {
if (choord_square (g.p[0], g.p[1])) return GAME_LOST;
+#ifdef FLAGALL_ON_CHOORD
+ } else if (HI_CELL.n == closed_neighbours(g.p[0], g.p[1])) {
+ flagall_square(g.p[0], g.p[1]);
+#endif
} else if (actor != MOUSE) {
show_stomp(1, g.p[0], g.p[1]);
} else if (actor != MOUSE) {
show_stomp(1, g.p[0], g.p[1]);
+int closed_neighbours (int line, int col) {
+ /* counts closed cells surrounding a square */
+
+ int count = 0;
+ AROUND(line, col) {
+ count += !AR_CELL.o;
+ }
+ return count;
+}
+
void interactive_resize(void) {
unsigned char buf[3];
int old_w = f.w;
void interactive_resize(void) {
unsigned char buf[3];
int old_w = f.w;
void show_stomp (int, int, int);
void wait_keypress (int);
int get_neighbours (int, int, int);
void show_stomp (int, int, int);
void wait_keypress (int);
int get_neighbours (int, int, int);
+int closed_neighbours (int, int);
int uncover_square (int, int);
void flag_square (int, int);
void quesm_square (int, int);
int uncover_square (int, int);
void flag_square (int, int);
void quesm_square (int, int);
+void flagall_square (int, int);
int choord_square (int, int);
int do_uncover (int*, int);
int grand_opening (int*);
int choord_square (int, int);
int do_uncover (int*, int);
int grand_opening (int*);