Skip to content

Commit 3cb1823

Browse files
committed
Use more consistent variable names
1 parent dd17f2b commit 3cb1823

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

day16/src/day16.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ data class Board(val rows: List<String>) {
3838
visited.add(Pair(start, startDir))
3939

4040
var shortestTotal: Int? = null
41-
val shortestPaths = mutableSetOf<Vec2>()
41+
val shortestPathVisited = mutableSetOf<Vec2>()
4242

4343
while (!queue.isEmpty()) {
4444
val node = queue.poll()
@@ -47,7 +47,7 @@ data class Board(val rows: List<String>) {
4747
}
4848
if (node.pos == end) {
4949
shortestTotal = node.total
50-
shortestPaths.addAll(node.visited)
50+
shortestPathVisited.addAll(node.visited)
5151
}
5252
visited.add(Pair(node.pos, node.dir))
5353

@@ -65,7 +65,7 @@ data class Board(val rows: List<String>) {
6565
}
6666
}
6767

68-
return shortestTotal?.let { ShortestPaths(it, shortestPaths) } ?: throw RuntimeException("No path found")
68+
return shortestTotal?.let { ShortestPaths(it, shortestPathVisited) } ?: throw RuntimeException("No path found")
6969
}
7070
}
7171

0 commit comments

Comments
 (0)