update a few of the benchmarks

This commit is contained in:
RussellChamp committed 2024-12-13 16:24:00 +00:00
1 parent a037d203af
commit 6502e63efe
4 files changed
+16 -9

No files matched your search

+2 -2
View File
@@ -27,7 +27,7 @@ pub fn part_one(input: &str) -> Option<u32> {
};
loop {
println!("At {:?} going {:?}", pos, dir);
// println!("At {:?} going {:?}", pos, dir);
let new_pos = (pos.0 + dir.0, pos.1 + dir.1);
if !is_valid_position(new_pos) { break }
@@ -46,7 +46,7 @@ pub fn part_one(input: &str) -> Option<u32> {
}
}
println!("Made it out!");
// println!("Made it out!");
Some(count_spaces(visited) as u32)
}
+1 -1
View File
@@ -9,7 +9,7 @@ pub fn part_one(input: &str) -> Option<u32> {
step_stones(&mut stones, 25);
let total_count = stones.len();
println!("FINAL STONES: {:?} stones", total_count);
// println!("FINAL STONES: {:?} stones", total_count);
Some(total_count as u32)
}
+2 -2
View File
@@ -72,14 +72,14 @@ pub fn part_two(input: &str) -> Option<u32> {
}
let w = plots.iter().map(|p| p.iter().map(|p| p.letter).collect::<String>()).join("\n");
println!("{}", w);
// println!("{}", w);
let total = regions.iter().sorted_by_key(|r| r.0).fold(0, |sum, (region_id, region)| {
let start_plot = find_plot(&plots, |p| p.region_id == Some(*region_id)).unwrap();
print!("REGION {}:", region.id);
let edges = traverse_start(&plots, &start_plot);
let total = sum + (region.count * edges);
println!(" = {} * {} = {}", region.count, edges, region.count * edges);
// println!(" = {} * {} = {}", region.count, edges, region.count * edges);
total
});