~cdv/aoc-2018-rs

49f811375160aa112e96521b8a5c9bd0318be602 — Christopher Vittal 2 years ago bdb18e3
Small tweak
1 files changed, 3 insertions(+), 3 deletions(-)

M src/bin/day18.rs
M src/bin/day18.rs => src/bin/day18.rs +3 -3
@@ 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;
    }
}