fix failing tests

This commit is contained in:
ktims committed 2026-12-02 13:51:10 -07:00
1 parent b9478fbb6b
commit ba83989539
14 files changed
+51 -149

No files matched your search

+10 -4
View File
@@ -108,10 +108,13 @@ impl Maze {
})
}
fn dijkstra(&self) -> usize {
let Coord2d {x: start_x, y: start_y} = self.map.find(&b'S').expect("can't find start");
let Coord2d { x: start_x, y: start_y } = self.map.find(&b'S').expect("can't find start");
let start = (start_x as CoordType, start_y as CoordType);
let Coord2d {x: finish_x, y: finish_y} = self.map.find(&b'E').expect("can't find finish");
let Coord2d {
x: finish_x,
y: finish_y,
} = self.map.find(&b'E').expect("can't find finish");
let finish = (finish_x as CoordType, finish_y as CoordType);
let mut distances = HashMap::new();
@@ -149,10 +152,13 @@ impl Maze {
usize::MAX
}
fn path_dijkstra(&mut self) -> (usize, Vec<Vec<Coord>>) {
let Coord2d {x: start_x, y: start_y} = self.map.find(&b'S').expect("can't find start");
let Coord2d { x: start_x, y: start_y } = self.map.find(&b'S').expect("can't find start");
let start = (start_x as CoordType, start_y as CoordType);
let Coord2d {x: finish_x, y: finish_y} = self.map.find(&b'E').expect("can't find finish");
let Coord2d {
x: finish_x,
y: finish_y,
} = self.map.find(&b'E').expect("can't find finish");
let finish = (finish_x as CoordType, finish_y as CoordType);
let mut distances = HashMap::new();