Compare commits
2 Commits
a96624e0a0
...
8ae82163b4
Author | SHA1 | Date | |
---|---|---|---|
8ae82163b4 | |||
5a02a5bbe9 |
@ -7,7 +7,7 @@ struct Hand {
|
|||||||
|
|
||||||
impl From<&str> for Hand {
|
impl From<&str> for Hand {
|
||||||
fn from(s: &str) -> Self {
|
fn from(s: &str) -> Self {
|
||||||
Self { letter: s.0.chars().next().unwrap() }
|
Self { letter: s.chars().next().unwrap() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
23
src/day03/mod.rs
Normal file
23
src/day03/mod.rs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
use crate::read;
|
||||||
|
|
||||||
|
|
||||||
|
pub fn run() {
|
||||||
|
let input = read("02");
|
||||||
|
let lines = input
|
||||||
|
.lines()
|
||||||
|
.map(|l| {
|
||||||
|
l
|
||||||
|
});
|
||||||
|
|
||||||
|
#[cfg(feature = "part1")]
|
||||||
|
{
|
||||||
|
let a = "TODO";
|
||||||
|
eprintln!("Day 2, Part 01: {}", a);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "part2")]
|
||||||
|
{
|
||||||
|
let b = "TODO";
|
||||||
|
eprintln!("Day 2, Part 02: {}", b);
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ use std::path::Path;
|
|||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
mod day01;
|
mod day01;
|
||||||
mod day02;
|
mod day02;
|
||||||
|
mod day03;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let today = Local::now().day();
|
let today = Local::now().day();
|
||||||
@ -13,6 +14,9 @@ fn main() {
|
|||||||
if cfg!(feature = "day02") || (cfg!(feature = "today") && today == 2) {
|
if cfg!(feature = "day02") || (cfg!(feature = "today") && today == 2) {
|
||||||
day02::run();
|
day02::run();
|
||||||
}
|
}
|
||||||
|
if cfg!(feature = "day03") || (cfg!(feature = "today") && today == 3) {
|
||||||
|
day03::run();
|
||||||
|
}
|
||||||
println!("Finished, time taken: {:?}", now.elapsed())
|
println!("Finished, time taken: {:?}", now.elapsed())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user