diff --git a/justfile b/justfile index 60aaecf..5d17507 100644 --- a/justfile +++ b/justfile @@ -14,7 +14,7 @@ run: # Begin working on todays problem. Downloads input, creates template and opens the problem and code. begin: _input-folder - echo "const INPUT: &str = include_str!(\"../../input/{{day}}\"); const TEST_INPUT: &str = include_str!(\"../../input/{{day}}-test\"); fn main() {}" >> {{file}} + cp -n template.rs src/bin/{{day}}.rs rustfmt {{file}} curl --silent "https://adventofcode.com/{{year}}/day/{{dayWithout0}}/input" -H "Cookie: session=$AOC_SESSION" > "input/{{day}}" touch input/{{day}}-test diff --git a/template.rs b/template.rs new file mode 100644 index 0000000..b6a649a --- /dev/null +++ b/template.rs @@ -0,0 +1,18 @@ +use aoc2023::*; + +const INPUT: &str = include_str!("../../input/XX"); + +fn main() { + assert_example!(part1, "XX-test", 0); + println!("Part 1: {}", part1(INPUT)); + assert_example!(part2, "XX-test", 0); + println!("Part 2: {}", part2(INPUT)); +} + +fn part1(input: &str) -> usize { + 0 +} + +fn part2(input: &str) -> usize { + 0 +}