Cleanup
This commit is contained in:
parent
97fa4abec0
commit
6dba16a6fd
2 changed files with 1 additions and 3 deletions
|
@ -16,7 +16,7 @@ fun <T> dijkstra(start: T, goal: (T) -> Boolean, neighbors: (T) -> Sequence<Pair
|
||||||
visited.add(start)
|
visited.add(start)
|
||||||
|
|
||||||
for ((neighbor, distance) in neighbors(current)) {
|
for ((neighbor, distance) in neighbors(current)) {
|
||||||
if (neighbor in visited) continue;
|
if (neighbor in visited) continue
|
||||||
|
|
||||||
val newDistance = totalDistance + distance
|
val newDistance = totalDistance + distance
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import java.util.PriorityQueue
|
|
||||||
|
|
||||||
data class Position(val coordinate: Grid.Coordinate, val direction: Direction)
|
data class Position(val coordinate: Grid.Coordinate, val direction: Direction)
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue