From 0035d5295cc37bbcf7e8a33fcf199e9f84870000 Mon Sep 17 00:00:00 2001 From: Lars Martens Date: Mon, 11 Dec 2023 12:57:54 +0100 Subject: [PATCH] Improve template --- justfile | 2 +- template.rs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 template.rs 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 +}