Worked on fec 5

This commit is contained in:
2021-12-06 20:17:03 +01:00
parent cff618714a
commit 6a7cfae109

View File

@@ -8,6 +8,7 @@ fn main(){
let reader = BufReader::new(file);
let mut lines: Vec<((u32, u32),(u32, u32))> = Vec::new();
let mut max_val: u32 = 0;
for line in reader.lines(){
let line_as_string = line.unwrap();
@@ -18,9 +19,17 @@ fn main(){
let y1 = origin[1].parse::<u32>().unwrap();
let x2 = dest[0].parse::<u32>().unwrap();
let y2 = dest[1].parse::<u32>().unwrap();
if origin.iter().max().unwrap().parse::<u32>().unwrap() > max_val {
max_val = origin.iter().max().unwrap().parse::<u32>().unwrap();
}
if dest.iter().max().unwrap().parse::<u32>().unwrap() > max_val {
max_val = dest.iter().max().unwrap().parse::<u32>().unwrap();
}
if x1 == x2 || y1 == y2 {
lines.push(((x1,y1),(x2,y2)))
}
}
println!("Max Val: {}", max_val);
}