fix failing tests
This commit is contained in:
14 files changed
+51
-149
No files matched your search
+10
-4
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user