[rs] Set up very basic framework for running days
This commit is contained in:
parent
61cbdc5f31
commit
583cf9322a
4 changed files with 356 additions and 2 deletions
4
rs/src/d01.rs
Normal file
4
rs/src/d01.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
pub fn solve(input: String) -> anyhow::Result<()> {
|
||||
println!("TODO!");
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -1,3 +1,28 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
mod d01;
|
||||
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::{Parser, ValueEnum};
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, ValueEnum)]
|
||||
enum Day {
|
||||
D01,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Args {
|
||||
day: Day,
|
||||
file: PathBuf,
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let args = Args::parse();
|
||||
let input = fs::read_to_string(&args.file)?;
|
||||
|
||||
match args.day {
|
||||
Day::D01 => d01::solve(input)?,
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue