Commits

Shlomi Fish  committed 92d6aed

Merge differences.

  • Participants
  • Parent commits b9a98d3

Comments (0)

Files changed (1)

File black-hole-solitaire/c-solver/black_hole_solver.c

 
     s += strlen(match);
 
-    ret_code =
-        parse_card(&s,
-            &(solver->initial_foundation),
-            solver->initial_foundation_string
-        );
+    while (isspace(*s) && ((*s) != '\n'))
+    {
+        s++;
+    }
 
-    if (ret_code)
+    if ((*s) == '-')
     {
-        *error_line_number = 1;
-        return ret_code;
+        /* A non-initialized foundation. */
+        solver->initial_foundation_string[0] = '\0';
+        solver->initial_foundation = -1;
+        s++;
+    }
+    else
+    {
+        ret_code =
+            parse_card(&s,
+                    &(solver->initial_foundation),
+                    solver->initial_foundation_string
+                    );
+        if (ret_code)
+        {
+            *error_line_number = 1;
+            return ret_code;
+        }
     }
 
     if (*(s++) != '\n')