-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.rs
190 lines (162 loc) · 5.87 KB
/
mod.rs
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
extern crate itertools;
extern crate regex;
use colored::Colorize;
use std::env;
use crate::measure;
use crate::y2017::day01::day01;
use crate::y2017::day02::day02;
use crate::y2017::day03::day03;
use crate::y2017::day04::day04;
use crate::y2017::day05::day05;
use crate::y2017::day06::day06;
use crate::y2017::day07::day07;
use crate::y2017::day08::day08;
use crate::y2017::day09::day09;
use crate::y2017::day10::day10;
use crate::y2017::day11::day11;
use crate::y2017::day12::day12;
use crate::y2017::day13::day13;
use crate::y2017::day14::day14;
use crate::y2017::day15::day15;
use crate::y2017::day16::day16;
use crate::y2017::day17::day17;
use crate::y2017::day18::day18;
use crate::y2017::day19::day19;
use crate::y2017::day20::day20;
use crate::y2017::day21::day21;
use crate::y2017::day22::day22;
use crate::y2017::day23::day23;
use crate::y2017::day24::day24;
use crate::y2017::day25::day25;
mod day01;
mod day02;
mod day03;
mod day04;
mod day05;
mod day06;
mod day07;
mod day08;
mod day09;
mod day10;
mod day11;
mod day12;
mod day13;
mod day14;
mod day15;
mod day16;
mod day17;
mod day18;
mod day19;
mod day20;
mod day21;
mod day22;
mod day23;
mod day24;
mod day25;
pub(crate) fn y2017() {
let args: Vec<String> = env::args().collect();
println!();
println!("{}", format!("Advent of Code").red());
println!("{}", format!(" //2017").red());
println!();
if args.contains(&"all".to_string()) || args.contains(&"day01".to_string()) {
println!("{}", format!("--- day01:").underline().green());
measure!(day01());
}
if args.contains(&"all".to_string()) || args.contains(&"day02".to_string()) {
println!("{}", format!("--- day02:").underline().green());
measure!(day02());
}
if args.contains(&"all".to_string()) || args.contains(&"day03".to_string()) {
println!("{}", format!("--- day03:").underline().green());
measure!(day03());
}
if args.contains(&"all".to_string()) || args.contains(&"day04".to_string()) {
println!("{}", format!("--- day04:").underline().green());
measure!(day04());
}
if args.contains(&"all".to_string()) || args.contains(&"day05".to_string()) {
println!("{}", format!("--- day05:").underline().green());
measure!(day05());
}
if args.contains(&"all".to_string()) || args.contains(&"day06".to_string()) {
println!("{}", format!("--- day06:").underline().green());
measure!(day06());
}
if args.contains(&"all".to_string()) || args.contains(&"day07".to_string()) {
println!("{}", format!("--- day07:").underline().green());
measure!(day07());
}
if args.contains(&"all".to_string()) || args.contains(&"day08".to_string()) {
println!("{}", format!("--- day08:").underline().green());
measure!(day08());
}
if args.contains(&"all".to_string()) || args.contains(&"day09".to_string()) {
println!("{}", format!("--- day09:").underline().green());
measure!(day09());
}
if args.contains(&"all".to_string()) || args.contains(&"day10".to_string()) {
println!("{}", format!("--- day10:").underline().green());
measure!(day10());
}
if args.contains(&"all".to_string()) || args.contains(&"day11".to_string()) {
println!("{}", format!("--- day11:").underline().green());
measure!(day11());
}
if args.contains(&"all".to_string()) || args.contains(&"day12".to_string()) {
println!("{}", format!("--- day12:").underline().green());
measure!(day12());
}
if args.contains(&"all".to_string()) || args.contains(&"day13".to_string()) {
println!("{}", format!("--- day13:").underline().green());
measure!(day13());
}
if args.contains(&"all".to_string()) || args.contains(&"day14".to_string()) {
println!("{}", format!("--- day14:").underline().green());
measure!(day14());
}
if args.contains(&"all".to_string()) || args.contains(&"day15".to_string()) {
println!("{}", format!("--- day15:").underline().green());
measure!(day15());
}
if args.contains(&"all".to_string()) || args.contains(&"day16".to_string()) {
println!("{}", format!("--- day16:").underline().green());
measure!(day16());
}
if args.contains(&"all".to_string()) || args.contains(&"day17".to_string()) {
println!("{}", format!("--- day17:").underline().green());
measure!(day17());
}
if args.contains(&"all".to_string()) || args.contains(&"day18".to_string()) {
println!("{}", format!("--- day18:").underline().green());
measure!(day18());
}
if args.contains(&"all".to_string()) || args.contains(&"day19".to_string()) {
println!("{}", format!("--- day19:").underline().green());
measure!(day19());
}
if args.contains(&"all".to_string()) || args.contains(&"day20".to_string()) {
println!("{}", format!("--- day20:").underline().green());
measure!(day20());
}
if args.contains(&"all".to_string()) || args.contains(&"day21".to_string()) {
println!("{}", format!("--- day21:").underline().green());
measure!(day21());
}
if args.contains(&"all".to_string()) || args.contains(&"day22".to_string()) {
println!("{}", format!("--- day22:").underline().green());
measure!(day22());
}
if args.contains(&"all".to_string()) || args.contains(&"day23".to_string()) {
println!("{}", format!("--- day23:").underline().green());
measure!(day23());
}
if args.contains(&"all".to_string()) || args.contains(&"day24".to_string()) {
println!("{}", format!("--- day24:").underline().green());
measure!(day24());
}
if args.contains(&"all".to_string()) || args.contains(&"day25".to_string()) || args.contains(&"latest".to_string()) {
println!("{}", format!("--- day25:").underline().green());
measure!(day25());
}
}