This is a simple template for AOC solutions.
To start a new day (except for day1 which is stubbed already):
- cp src/DAY.rs src/dayX.rs
- Add
mod dayX;
near the top of main.rs. - In main.rs add a new branch to
main()
likeX => run_day!(dayX, dayX::DayX, &args.input),
near the others. - For the
DayX
struct that day, use whatever fields your inputs requires; this will often been some Vec field. - Implement
from_input()
to parse the input string into yourDayX
struct. Iterator functions are great for this. - Implement
solve_part1()
. - Implement
solve_part2()
.
Run your solution with cargo run -- --day X --part P input/dayX.input
You can also use aoc-cli to manage your inputs. If you do, download the day's input with aoc -y Y -d D download
.
Good luck!