DEVELOPMENT ENVIRONMENT

~liljamo/aoc2024

ref: d978ab7908e2a7fd929ea3144d9ff925f6400e15 aoc2024/src/main.rs -rw-r--r-- 2.6 KiB
d978ab79Jonni Liljamo feat: day15 partly a month ago
                                                                                
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
use std::path::PathBuf;

use clap::{Parser, Subcommand};

mod day1;
mod day10;
mod day11;
mod day12;
mod day13;
mod day14;
mod day15;
mod day2;
mod day3;
mod day4;
mod day5;
mod day6;
mod day7;
mod day8;
mod day9;

#[derive(Parser)]
struct Args {
    #[command(subcommand)]
    day: DayArgs,
}

#[derive(Subcommand)]
enum DayArgs {
    Day1 {
        #[arg(short)]
        input: PathBuf,
    },
    Day2 {
        #[arg(short)]
        input: PathBuf,
    },
    Day3 {
        #[arg(short)]
        input: PathBuf,
    },
    Day4 {
        #[arg(short)]
        input: PathBuf,
    },
    Day5 {
        #[arg(short)]
        input: PathBuf,
    },
    Day6 {
        #[arg(short)]
        input: PathBuf,
    },
    Day7 {
        #[arg(short)]
        input: PathBuf,
    },
    Day8 {
        #[arg(short)]
        input: PathBuf,
    },
    Day9 {
        #[arg(short)]
        input: PathBuf,
    },
    Day10 {
        #[arg(short)]
        input: PathBuf,
    },
    Day11 {
        #[arg(short)]
        input: PathBuf,
    },
    Day12 {
        #[arg(short)]
        input: PathBuf,
    },
    Day13 {
        #[arg(short)]
        input: PathBuf,
    },
    Day14 {
        #[arg(short)]
        input: PathBuf,
    },
    Day15 {
        #[arg(short)]
        input: PathBuf,
    },
}

fn main() -> anyhow::Result<()> {
    let args = Args::parse();

    match args.day {
        DayArgs::Day1 { input } => {
            day1::solve(&input)?;
        }
        DayArgs::Day2 { input } => {
            day2::solve(&input)?;
        }
        DayArgs::Day3 { input } => {
            day3::solve(&input)?;
        }
        DayArgs::Day4 { input } => {
            day4::solve(&input)?;
        }
        DayArgs::Day5 { input } => {
            day5::solve(&input)?;
        }
        DayArgs::Day6 { input } => {
            day6::solve(&input)?;
        }
        DayArgs::Day7 { input } => {
            day7::solve(&input)?;
        }
        DayArgs::Day8 { input } => {
            day8::solve(&input)?;
        }
        DayArgs::Day9 { input } => {
            day9::solve(&input)?;
        }
        DayArgs::Day10 { input } => {
            day10::solve(&input)?;
        }
        DayArgs::Day11 { input } => {
            day11::solve(&input)?;
        }
        DayArgs::Day12 { input } => {
            day12::solve(&input)?;
        }
        DayArgs::Day13 { input } => {
            day13::solve(&input)?;
        }
        DayArgs::Day14 { input } => {
            day14::solve(&input)?;
        }
        DayArgs::Day15 { input } => {
            day15::solve(&input)?;
        }
    }

    Ok(())
}