Skip to content

Commit 7983bea

Browse files
committed
Rename bfs to pathfinding in day24
1 parent d189fc5 commit 7983bea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/bin/24.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn forward_blizzards(blizzards: &PointGrid<BlizzardList>) -> PointGrid<BlizzardL
107107
result
108108
}
109109

110-
fn bfs(
110+
fn pathfinding(
111111
bl_cache: &[PointGrid<BlizzardList>],
112112
start: &Point<isize>,
113113
end: &Point<isize>,
@@ -197,16 +197,16 @@ pub fn part_one(_input: &str) -> Option<usize> {
197197
let (grid, start, end) = parse_input(_input);
198198
let (bl_cache, cycle_length, max_distance) = init_valley(&grid);
199199

200-
bfs(&bl_cache, &start, &end, 0, cycle_length, max_distance)
200+
pathfinding(&bl_cache, &start, &end, 0, cycle_length, max_distance)
201201
}
202202

203203
pub fn part_two(_input: &str) -> Option<usize> {
204204
let (grid, start, end) = parse_input(_input);
205205
let (bl_cache, cycle_length, max_distance) = init_valley(&grid);
206206

207-
let goal1 = bfs(&bl_cache, &start, &end, 0, cycle_length, max_distance).unwrap();
208-
let goal2 = bfs(&bl_cache, &end, &start, goal1, cycle_length, max_distance).unwrap();
209-
bfs(&bl_cache, &start, &end, goal2, cycle_length, max_distance)
207+
let goal1 = pathfinding(&bl_cache, &start, &end, 0, cycle_length, max_distance).unwrap();
208+
let goal2 = pathfinding(&bl_cache, &end, &start, goal1, cycle_length, max_distance).unwrap();
209+
pathfinding(&bl_cache, &start, &end, goal2, cycle_length, max_distance)
210210
}
211211

212212
fn main() {

0 commit comments

Comments
 (0)