prepare next day
This commit is contained in:
34
src/day03.rs
Normal file
34
src/day03.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
use std::fs::read_to_string;
|
||||
|
||||
pub fn day_main() {
|
||||
let input = read_to_string("input/day03.txt").unwrap();
|
||||
println!("part1: {}", part1(&input));
|
||||
println!("part2: {}", part2(&input));
|
||||
}
|
||||
|
||||
type RiddleResult = usize;
|
||||
|
||||
fn part1(input: &str) -> RiddleResult {
|
||||
0
|
||||
}
|
||||
|
||||
fn part2(_input: &str) -> RiddleResult {
|
||||
0
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::{part1, part2};
|
||||
|
||||
const TEST_INPUT: &str = r"
|
||||
";
|
||||
|
||||
#[test]
|
||||
fn test1() {
|
||||
assert_eq!(part1(TEST_INPUT), 0);
|
||||
}
|
||||
#[test]
|
||||
fn test2() {
|
||||
assert_eq!(part2(TEST_INPUT), 0);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +1,3 @@
|
||||
pub mod day01;
|
||||
pub mod day02;
|
||||
pub mod day03;
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
use std::env::args;
|
||||
|
||||
use advent_of_rust_2024::{day01, day02};
|
||||
use advent_of_rust_2024::*;
|
||||
|
||||
fn main() {
|
||||
let day: Option<u8> = args().nth(1).and_then(|a| a.parse().ok());
|
||||
match day {
|
||||
Some(1) => day01::day_main(),
|
||||
Some(2) => day02::day_main(),
|
||||
_ => println!("hi"),
|
||||
Some(3) => day03::day_main(),
|
||||
_ => println!("Please select a day to run"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user