Switch to other account, new riddles
This commit is contained in:
parent
556b85e532
commit
96fca503ab
19 changed files with 8869 additions and 8946 deletions
48
src/days/day16/mod.rs
Normal file
48
src/days/day16/mod.rs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
use super::template::{DayTrait, ResultType};
|
||||
|
||||
const DAY_NUMBER: usize = 16;
|
||||
|
||||
pub struct Day;
|
||||
|
||||
impl DayTrait for Day {
|
||||
fn get_day_number(&self) -> usize {
|
||||
DAY_NUMBER
|
||||
}
|
||||
|
||||
fn part1(&self, _lines: &[String]) -> anyhow::Result<ResultType> {
|
||||
Ok(ResultType::Nothing)
|
||||
}
|
||||
|
||||
fn part2(&self, _lines: &[String]) -> anyhow::Result<ResultType> {
|
||||
Ok(ResultType::Nothing)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::common::file::read_lines;
|
||||
use anyhow::Result;
|
||||
|
||||
#[test]
|
||||
fn test_part1() -> Result<()> {
|
||||
let day = Day {};
|
||||
let lines = read_lines(day.get_day_number(), "example01.txt")?;
|
||||
let expected = ResultType::Nothing;
|
||||
let result = day.part1(&lines)?;
|
||||
assert_eq!(result, expected);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_part2() -> Result<()> {
|
||||
let day = Day {};
|
||||
let lines = read_lines(day.get_day_number(), "example01.txt")?;
|
||||
let expected = ResultType::Nothing;
|
||||
let result = day.part2(&lines)?;
|
||||
assert_eq!(result, expected);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ mod day12;
|
|||
mod day13;
|
||||
mod day14;
|
||||
mod day15;
|
||||
mod day16;
|
||||
mod template;
|
||||
|
||||
pub use template::DayTrait;
|
||||
|
|
@ -22,7 +23,7 @@ pub mod day_provider {
|
|||
use super::*;
|
||||
use thiserror::Error;
|
||||
|
||||
const MAX_DAY: usize = 15;
|
||||
const MAX_DAY: usize = 16;
|
||||
|
||||
pub fn get_day(day_num: usize) -> Result<Box<dyn DayTrait>, ProviderError> {
|
||||
match day_num {
|
||||
|
|
@ -41,6 +42,7 @@ pub mod day_provider {
|
|||
13 => Ok(Box::new(day13::Day)),
|
||||
14 => Ok(Box::new(day14::Day)),
|
||||
15 => Ok(Box::new(day15::Day)),
|
||||
16 => Ok(Box::new(day16::Day)),
|
||||
_ => Err(ProviderError::InvalidNumber(day_num)),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue