@@ 30,6 30,7 @@ fn main() {
let mut m = FxHashMap::default();
let mut t = 0;
while t < MAX_TIME {
+ t += 1;
let mut new = Matrix::new_square(YARD_SIZE, b'.');
for r in 0..yard.rows {
for c in 0..yard.columns {
@@ 54,11 55,10 @@ fn main() {
let skip = (MAX_TIME - t) / (t - t_);
t += skip * (t - t_);
}
- if t == PART_ONE - 1 || t == MAX_TIME - 1 {
+ if t == PART_ONE || t == MAX_TIME {
let trees = bytecount::count(yard.as_ref(), b'|');
let lumber = bytecount::count(yard.as_ref(), b'#');
- println!(" {}: {}", 1 + (t == MAX_TIME - 1) as u8, trees * lumber)
+ println!(" {}: {}", 1 + (t == MAX_TIME) as u8, trees * lumber)
}
- t += 1;
}
}