|
@@ -48,7 +48,6 @@ pub fn part_two(input: &str) -> Option<i32> {
|
|
let mut waiting = false;
|
|
let mut waiting = false;
|
|
|
|
|
|
for clock in 0..240 {
|
|
for clock in 0..240 {
|
|
- println!("cycle {clock} val {register}");
|
|
|
|
if clock > 1 && clock % 40 == 0 {
|
|
if clock > 1 && clock % 40 == 0 {
|
|
output += "\n";
|
|
output += "\n";
|
|
}
|
|
}
|
|
@@ -60,7 +59,6 @@ pub fn part_two(input: &str) -> Option<i32> {
|
|
|
|
|
|
match queued_ad {
|
|
match queued_ad {
|
|
Some(i) => {
|
|
Some(i) => {
|
|
- println!("cycle {clock} finishing addx {i}");
|
|
|
|
register += i;
|
|
register += i;
|
|
queued_ad = None;
|
|
queued_ad = None;
|
|
continue;
|
|
continue;
|
|
@@ -69,12 +67,9 @@ pub fn part_two(input: &str) -> Option<i32> {
|
|
}
|
|
}
|
|
|
|
|
|
let op = lines.next().unwrap();
|
|
let op = lines.next().unwrap();
|
|
- println!("op is {op}");
|
|
|
|
if op.starts_with("n") {
|
|
if op.starts_with("n") {
|
|
// do nothing this clock cycle
|
|
// do nothing this clock cycle
|
|
- println!("cycle {clock} noop");
|
|
|
|
} else {
|
|
} else {
|
|
- println!("cycle {clock} queuing add");
|
|
|
|
queued_ad = Some(op.split_once(" ").unwrap().1.parse().unwrap());
|
|
queued_ad = Some(op.split_once(" ").unwrap().1.parse().unwrap());
|
|
waiting = true;
|
|
waiting = true;
|
|
}
|
|
}
|