Permalink
Browse files

don't exit until exploring the whole map when we only have an imperfe…

…ct sol
  • Loading branch information...
1 parent 3086c5b commit c1e97680096b747d6ea0c89bb6eec4ad9413cb68 @sidnair sidnair committed Dec 7, 2011
Showing with 18 additions and 0 deletions.
  1. +6 −0 game/GameConfig.txt
  2. +8 −0 src/mirroruniverse/g6/G6Player.java
  3. +4 −0 src/mirroruniverse/g6/Solution.java
View
@@ -1,6 +1,12 @@
1, 30, 1, -1, maps/g7maps/map_50_50_illusion_1.txt
1, 30, 1, -1, maps/g7maps/map_50_50_illusion_2.txt
+-1, -1, 2, -1, maps/g5maps/g5bigmap1.txt
+-1, -1, 2, -1, maps/g5maps/g5bigmap2.txt
+
+1, 30, 1, -1, maps/g7maps/map_50_50_illusion_1.txt
+1, 30, 1, -1, maps/g7maps/map_50_50_illusion_2.txt
+
-1, -1, 5, -1, maps/Board1_L.txt
-1, -1, 5, -1, maps/Board1_R.txt
@@ -156,6 +156,7 @@ private boolean shouldRecomputeSolution() {
return true;
}
}
+ /*
if (solution != null && solution.getDiff() > 0 && !solution.isFake()) {
if (isNextToExit(left, x1, y1) || isNextToExit(right, x2, y2)) {
if (SID_DEBUG_RECOMPUTE_INFO) {
@@ -164,6 +165,7 @@ private boolean shouldRecomputeSolution() {
return true;
}
}
+ */
if (SID_DEBUG_RECOMPUTE_INFO) {
System.out.println("no recompute: fall through");
}
@@ -819,6 +821,9 @@ private int getMultiSolutionStep() {
if (solution == null) {
return -1;
} else {
+ if (solution.onFinalStep() && !isFullyExplored()) {
+ return -1;
+ }
return solution.getNextStep();
}
}
@@ -837,6 +842,9 @@ private int getMultiSolutionStep() {
}
if (solution != null) {
+ if (solution.onFinalStep() && !isFullyExplored()) {
+ return -1;
+ }
return solution.getNextStep();
}
}
@@ -77,4 +77,8 @@ public String toString() {
return s;
}
+ public boolean onFinalStep() {
+ return currentStep == steps.length - 1;
+ }
+
}

0 comments on commit c1e9768

Please sign in to comment.