chiark / gitweb /
Rename the docs section for Rectangles.
[sgt-puzzles.git] / solo.c
diff --git a/solo.c b/solo.c
index c7ed61be9a566ac52cc3bfe9d688b7f508ea102f..631d335622b87231e22c05b6d2bddba50b756d03 100644 (file)
--- a/solo.c
+++ b/solo.c
@@ -3849,7 +3849,11 @@ static char *spec_to_dsf(const char **pdesc, int **pdsf, int cr, int area)
             * Non-edge; merge the two dsf classes on either
             * side of it.
             */
-           assert(pos < 2*cr*(cr-1));
+           if (pos >= 2*cr*(cr-1)) {
+                sfree(dsf);
+                return "Too much data in block structure specification";
+            }
+
            if (pos < cr*(cr-1)) {
                int y = pos/(cr-1);
                int x = pos%(cr-1);
@@ -4610,6 +4614,9 @@ static char *interpret_move(const game_state *state, game_ui *ui,
        return dupstr(buf);
     }
 
+    if (button == 'M' || button == 'm')
+        return dupstr("M");
+
     return NULL;
 }
 
@@ -4661,6 +4668,21 @@ static game_state *execute_move(const game_state *from, const char *move)
             }
         }
        return ret;
+    } else if (move[0] == 'M') {
+       /*
+        * Fill in absolutely all pencil marks in unfilled squares,
+        * for those who like to play by the rigorous approach of
+        * starting off in that state and eliminating things.
+        */
+       ret = dup_game(from);
+        for (y = 0; y < cr; y++) {
+            for (x = 0; x < cr; x++) {
+                if (!ret->grid[y*cr+x]) {
+                    memset(ret->pencil + (y*cr+x)*cr, 1, cr);
+                }
+            }
+        }
+       return ret;
     } else
        return NULL;                   /* couldn't parse move string */
 }