mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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]
This commit is contained in:
2
net.c
2
net.c
@ -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) {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user