Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add path finder

  • Loading branch information...
commit 4652bb2ee19261976e3d25b128354d7681b9f64f 1 parent ac490f5
@liweinan authored
View
1  src/main/java/io/maze/Maze.java
@@ -50,7 +50,6 @@ public void generate() {
System.out.println("LEGEND: C- CANDIDATE, D- DECISION, R- RESULT, G- GO BACK");
while (histories.size() > 0 && visited_cnt < m*n) {
-
while (currentCell != null) {
currentCell = nextCell(currentCell);
if (currentCell != null) {
View
13 src/main/java/io/maze/cell/CellState.java
@@ -1,8 +1,5 @@
package io.maze.cell;
-import io.maze.cell.Cell;
-import io.maze.doors.*;
-
/**
* Created with IntelliJ IDEA.
* User: weli
@@ -14,6 +11,8 @@
private boolean visited = false;
private int x, y;
+ private boolean inPath = false;
+
public boolean isVisited() {
return visited;
}
@@ -37,4 +36,12 @@ public int getY() {
public void setY(int y) {
this.y = y;
}
+
+ public boolean isInPath() {
+ return inPath;
+ }
+
+ public void setInPath(boolean inPath) {
+ this.inPath = inPath;
+ }
}
View
15 src/main/java/io/maze/finder/PathFinder.java
@@ -0,0 +1,15 @@
+package io.maze.finder;
+
+import io.maze.Maze;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: weinanli
+ * Date: 3/24/13
+ * Time: 1:01 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public interface PathFinder {
+
+ public void solve(Maze maze);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.