From b2c5bc0d97d413a9d59cb6a455b5222fbfc8f892 Mon Sep 17 00:00:00 2001 From: philippe lhardy Date: Tue, 5 Dec 2017 08:41:21 +0100 Subject: [PATCH] resolve still to fix --- java/org/artisanlogiciel/games/LabyModel.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/java/org/artisanlogiciel/games/LabyModel.java b/java/org/artisanlogiciel/games/LabyModel.java index 27dff48..86b968c 100644 --- a/java/org/artisanlogiciel/games/LabyModel.java +++ b/java/org/artisanlogiciel/games/LabyModel.java @@ -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