Worked on fec 5
This commit is contained in:
@@ -8,6 +8,7 @@ fn main(){
|
|||||||
let reader = BufReader::new(file);
|
let reader = BufReader::new(file);
|
||||||
|
|
||||||
let mut lines: Vec<((u32, u32),(u32, u32))> = Vec::new();
|
let mut lines: Vec<((u32, u32),(u32, u32))> = Vec::new();
|
||||||
|
let mut max_val: u32 = 0;
|
||||||
|
|
||||||
for line in reader.lines(){
|
for line in reader.lines(){
|
||||||
let line_as_string = line.unwrap();
|
let line_as_string = line.unwrap();
|
||||||
@@ -18,9 +19,17 @@ fn main(){
|
|||||||
let y1 = origin[1].parse::<u32>().unwrap();
|
let y1 = origin[1].parse::<u32>().unwrap();
|
||||||
let x2 = dest[0].parse::<u32>().unwrap();
|
let x2 = dest[0].parse::<u32>().unwrap();
|
||||||
let y2 = dest[1].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 {
|
if x1 == x2 || y1 == y2 {
|
||||||
lines.push(((x1,y1),(x2,y2)))
|
lines.push(((x1,y1),(x2,y2)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
println!("Max Val: {}", max_val);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user