WIP day 2

This commit is contained in:
Max Nuding 2022-12-02 05:15:03 +00:00
parent d8f191fd9b
commit 8dc9b8fcbb
2 changed files with 2522 additions and 5 deletions

2500
input/02.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,27 @@
use crate::read; use crate::read;
struct Hand {
pub letter: char,
}
struct Round {
enemy: Hand,
me: Hand,
}
pub fn run() { pub fn run() {
let input = read("02"); let input = read("02");
let lines = input.lines(); let lines = input.lines().map(|l| {
let hands = l.split(' ').collect::<Vec<_>>();
Round {
enemy: Hand {
letter: hands.first().unwrap().chars().next().unwrap(),
},
me: Hand {
letter: hands[1].chars().next().unwrap(),
},
}
});
#[cfg(feature = "part1")] #[cfg(feature = "part1")]
{ {