diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-05-22 11:45:20 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-05-22 11:45:20 +0000 |
| commit | 0066cdd62aea5bde96903682e7fbdadfd5fd08d9 (patch) | |
| tree | 3a6d785af913cb363f33c6b5f2cc1c66c8752908 /net.c | |
| parent | fc3f16b364e64ad01c3c1d19e99051b922e2a4f8 (diff) | |
| download | puzzles-0066cdd62aea5bde96903682e7fbdadfd5fd08d9.zip puzzles-0066cdd62aea5bde96903682e7fbdadfd5fd08d9.tar.gz puzzles-0066cdd62aea5bde96903682e7fbdadfd5fd08d9.tar.bz2 puzzles-0066cdd62aea5bde96903682e7fbdadfd5fd08d9.tar.xz | |
Special case in dead-end checking which prevents the solver falling
over on a grid containing a 0 (completely blank) tile. This can't
happen in self-generated grids, but can happen if you type in a grid
from another Net implementation. Previously, the solver would notice
(technically correctly!) that a completely blank tile connects to no
other tiles and thus forms an isolated subgraph, and would therefore
complain that no orientation of that tile could possibly yield a
valid solution...
[originally from svn r5828]
Diffstat (limited to 'net.c')
| -rw-r--r-- | net.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -657,7 +657,7 @@ static int net_solver(int w, int h, unsigned char *tiles, * dead ends of size 2 and 3 forms a subnetwork * with a total area of 6, not 5.) */ - if (deadendtotal+1 < area) + if (deadendtotal > 0 && deadendtotal+1 < area) valid = FALSE; } else if (nnondeadends == 1) { /* |