Improve template
This commit is contained in:
parent
ab7b9af735
commit
0035d5295c
2 changed files with 19 additions and 1 deletions
2
justfile
2
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
|
||||
|
|
18
template.rs
Normal file
18
template.rs
Normal file
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue