Commit 45566943 authored by Marcel Behrmann's avatar Marcel Behrmann

day(19): cleanup

parent 87b8d25d
......@@ -10,7 +10,7 @@ fn main() {
let file = &fs::read_to_string(INPUT_FILE).expect("Error reading input");
let input = get_input(file);
//println!("Result part 1: {}", part_01(&input));
println!("Result part 1: {}", part_01(&input));
println!("Result part 2: {}", part_02(&input));
}
......@@ -63,32 +63,22 @@ fn part_02(input: &Vec<&str>) -> i64{
current.0 += 1;
}
println!("Checking row: {:?}", current.1);
for offset in 0..200 {
if !is_on_beam(&mut vm, (current.0 + offset + 99, current.1)) {
break;
}
//println!("\ttop right corner is in the beam");
if !is_on_beam(&mut vm, (current.0 + offset, current.1 + 99)) {
continue;
}
//println!("\tbottom left corner is in the beam");
//println!("{:?}", (current.0 + offset, current.1));
return (current.0 + offset) * 10_000 + current.1;
}
current.1 += 1;
}
//let width_deeper = get_count_for_row(r+200);
//println!("Should fit here: {},{}", x, y);
0
panic!("Did not find a solution");
}
fn is_on_beam(vm: &mut intvm::IntVM, coords: (i64, i64)) -> bool {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment