Template
Completed template for advent of code XXXX
This commit is contained in:
@@ -27,11 +27,26 @@ pub mod day25;
|
||||
use crate::utils::{self, get_input};
|
||||
use std::{error::Error, fmt::Display, time::SystemTime};
|
||||
|
||||
// Solution class running your answers for part 1 and 2.
|
||||
pub trait Solution: Send + Sync {
|
||||
// Insert your solution for part one in here,
|
||||
// returning it as a:
|
||||
///```
|
||||
/// OK(Box::new(ans))
|
||||
/// ```
|
||||
fn part1(&self, input: &mut Vec<String>) -> Result<Box<dyn Display>, Box<dyn Error>>;
|
||||
|
||||
// Insert your solution for part two in here,
|
||||
// returning it as a:
|
||||
///```
|
||||
/// OK(Box::new(ans))
|
||||
/// ```
|
||||
fn part2(&self, input: &mut Vec<String>) -> Result<Box<dyn Display>, Box<dyn Error>>;
|
||||
|
||||
// Returns the day that is currently being run
|
||||
fn get_day(&self) -> u8;
|
||||
|
||||
// Runs part 1 and 2 for each day synchronously (One after the other)
|
||||
fn run(&self) -> Result<Run, Box<dyn std::error::Error>> {
|
||||
let start_time = SystemTime::now();
|
||||
|
||||
|
||||
@@ -33,3 +33,5 @@ pub fn get_input(day: u8, input: InputType) -> Result<Vec<String>, Box<dyn Error
|
||||
|
||||
Ok(data)
|
||||
}
|
||||
|
||||
/* Insert any utils you create in this file here */
|
||||
|
||||
Reference in New Issue
Block a user