2023-12-02 12:01:30 -07:00
|
|
|
pub trait Day: std::fmt::Debug {
|
|
|
|
fn part1(&mut self) -> String;
|
|
|
|
fn part2(&mut self) -> String;
|
2023-12-03 00:27:13 -07:00
|
|
|
fn parse(&mut self) {}
|
|
|
|
fn solve(&mut self, part: u8) -> String {
|
2023-12-02 12:01:30 -07:00
|
|
|
self.parse();
|
|
|
|
match part {
|
|
|
|
1 => self.part1(),
|
|
|
|
2 => self.part2(),
|
2023-12-03 00:27:13 -07:00
|
|
|
_ => panic!("Invalid part #"),
|
2023-12-02 12:01:30 -07:00
|
|
|
}
|
|
|
|
}
|
2023-12-03 00:27:13 -07:00
|
|
|
}
|