resolve still to fix

This commit is contained in:
philippe lhardy
2017-12-05 08:41:21 +01:00
parent a43e1e5a68
commit b2c5bc0d97

View File

@@ -723,9 +723,9 @@ TODO
Position p = new Position(newx,newy);
if ((newx >= 0) && (newy >= 0) && (newx < width) && (newy < height))
{
System.out.println("check " + p);
if (isFlagSet(getCell(p),reversedirection))
{
System.out.println("check " + p);
if (found != null)
{
// could be a unique parent of two paths...
@@ -740,27 +740,24 @@ TODO
DirectionPosition altfound = new DirectionPosition(reversedirection,p);
cp.addFirst(altfound);
altpath.addLast(cp);
rlistener.notifySearchError("record alternate path " + p.toString());
}
else
{
// this was already solved, might be a loop.
if (rlistener != null)
{
rlistener.notifySearchError("Loop : two parents " + found.toString() + " "
rlistener.notifySearchError("Loop " + last.toString() + " has two parents " + found.toString() + " "
+ p.toString());
}
continue;
// continue;
}
}
}
selectedDirection=reversedirection;
if (isFlagSet(getCell(p), SOLVED ))
if (! isFlagSet(getCell(p), SOLVED ))
{
// was already solved.
found = null;
}
else
{
found = new DirectionPosition(selectedDirection,p);
if (rlistener != null)
{
@@ -768,7 +765,10 @@ TODO
}
}
// support multiple pathes
// break;
}
else
{
System.out.println("not reachable " + p + " from " + found);
}
}
else