Complete day5 part2

This commit is contained in:
Blizzard Finnegan 2023-12-06 15:28:32 -05:00
parent 177fdba129
commit 96b41d2d0c
Signed by: blizzardfinnegan
GPG key ID: 61C1E13067E0018E

View file

@ -103,12 +103,13 @@ fn main() {
calculated_locations.push(thread::spawn(move ||{
let seed = cloned_seed;
let mut final_location = usize::MAX;
for i in seed.first_val..(seed.first_val+seed.range){
for i in seed.first_val..=(seed.first_val+seed.range){
let mut calc_location = i;
for map in map_ref.iter(){
let calc_location = map.convert(i);
if calc_location < final_location{
final_location = calc_location;
}
calc_location = map.convert(calc_location);
}
if calc_location <= final_location && calc_location != 0{
final_location = calc_location;
}
}
println!("Finished with seed: {:?}",seed);
@ -124,6 +125,7 @@ fn main() {
}
}
println!("");
println!("{}",final_output);
}