diff options
| author | Simon Tatham <anakin@pobox.com> | 2004-12-08 08:08:00 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2004-12-08 08:08:00 +0000 |
| commit | 47e9419452a9fca895f1c84412ab1040d1aa86a5 (patch) | |
| tree | 579c21b61ce599fb9bd2364b4da826ccbf134c31 /pattern.c | |
| parent | 03e455c2c625fdaad509f5cd56382b8b3bb1eb03 (diff) | |
| download | puzzles-47e9419452a9fca895f1c84412ab1040d1aa86a5.zip puzzles-47e9419452a9fca895f1c84412ab1040d1aa86a5.tar.gz puzzles-47e9419452a9fca895f1c84412ab1040d1aa86a5.tar.bz2 puzzles-47e9419452a9fca895f1c84412ab1040d1aa86a5.tar.xz | |
Game completion detection was occasionally failing to spot a
lingering GRID_UNKNOWN, causing it to declare victory too soon.
[originally from svn r4954]
Diffstat (limited to 'pattern.c')
| -rw-r--r-- | pattern.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -322,16 +322,16 @@ int compute_rowdata(int *ret, unsigned char *start, int len, int step) n = 0; for (i = 0; i < len; i++) { - if (start[i*step] == GRID_UNKNOWN) - return -1; - if (start[i*step] == GRID_FULL) { int runlen = 1; - while (i+runlen < len && start[(i+runlen)*step]) + while (i+runlen < len && start[(i+runlen)*step] == GRID_FULL) runlen++; ret[n++] = runlen; i += runlen; } + + if (start[i*step] == GRID_UNKNOWN) + return -1; } return n; |