File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ data class Board(val rows: List<String>) {
38
38
visited.add(Pair (start, startDir))
39
39
40
40
var shortestTotal: Int? = null
41
- val shortestPaths = mutableSetOf<Vec2 >()
41
+ val shortestPathVisited = mutableSetOf<Vec2 >()
42
42
43
43
while (! queue.isEmpty()) {
44
44
val node = queue.poll()
@@ -47,7 +47,7 @@ data class Board(val rows: List<String>) {
47
47
}
48
48
if (node.pos == end) {
49
49
shortestTotal = node.total
50
- shortestPaths .addAll(node.visited)
50
+ shortestPathVisited .addAll(node.visited)
51
51
}
52
52
visited.add(Pair (node.pos, node.dir))
53
53
@@ -65,7 +65,7 @@ data class Board(val rows: List<String>) {
65
65
}
66
66
}
67
67
68
- return shortestTotal?.let { ShortestPaths (it, shortestPaths ) } ? : throw RuntimeException (" No path found" )
68
+ return shortestTotal?.let { ShortestPaths (it, shortestPathVisited ) } ? : throw RuntimeException (" No path found" )
69
69
}
70
70
}
71
71
You can’t perform that action at this time.
0 commit comments