aboutsummaryrefslogtreecommitdiffstats
path: root/y2021/src/main.rs
blob: 925ba542f65218949093517f1e5a742842e808e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use y2021:: {
    d01, d02,
    utils::get_input_for_day,
};

use std::{
    collections::HashSet,
    env,
};

fn main() {
    let args = env::args().skip(1).collect::<HashSet<_>>();

    // day 1
    if args.is_empty() || args.contains("1") {
        let a = d01::part1(get_input_for_day(1));
        println!("2021: day 1 part 1: {}", a);

        let a = d01::part2(get_input_for_day(1));
        println!("2021: day 1 part 2: {}", a);
    }

    // day 2
    if args.is_empty() || args.contains("2") {
        let a = d02::part1(get_input_for_day(2));
        println!("2021: day 2 part 1: {}", a);

        let a = d02::part2(get_input_for_day(2));
        println!("2021: day 2 part 2: {}", a);
    }
}