diff --git a/2022/day/2/input b/2022/day/2/input new file mode 100644 index 0000000..09bd2de --- /dev/null +++ b/2022/day/2/input @@ -0,0 +1,2500 @@ +A X +B Y +B Y +C X +B X +C Z +C Z +A Z +A Z +B Y +C Z +A Z +C Z +C X +B Z +C Z +C Z +C Z +B Y +C Z +C Z +C Z +A Z +A Y +B Z +B Z +A Y +B X +C Z +C Z +A Z +A Z +C Z +A Y +A X +A Z +A Z +B X +B Z +B X +A Z +B X +B Z +B Z +C Z +A Z +A Z +A Z +C Z +B Z +A Z +A Y +A Y +B Y +B Y +B Z +A Z +B Z +A Z +B Z +C Z +B Y +A Z +B Y +A Z +A Z +A Z +C Z +A Y +A Z +C Z +C Z +A Z +A X +B Y +C Z +A Z +A Z +C X +C Z +B X +C X +B X +A Z +C Z +C Z +A Y +A Z +B X +C X +A Z +A Z +C Z +C Z +B Y +C Z +A Z +A Z +A Y +B X +B Y +A Z +C Z +A Z +A Z +A Z +C X +C Y +C Z +B X +B X +B X +A Z +A X +C Z +A Z +B Y +B X +A Y +B X +A Z +C Z +C Z +A X +A Z +C Z +B Z +B X +A Z +C Z +C Z +C X +C Z +C Z +C Z +A Y +B X +A Y +A Z +B Z +B Z +C Z +B Z +B Z +B X +A Z +C Z +A Z +A Y +C Z +A Z +C X +A Z +A Z +A Y +A Y +A Z +C Z +B Y +A X +A Z +A Y +C Z +A Z +B X +A Z +B Y +A X +C X +B X +A Y +A Z +B Z +A Z +A Z +B X +A X +C Z +B X +B Y +A Z +B X +C Z +A Z +C Z +B X +A Z +A Y +A Z +A Z +B X +B X +B Z +A Z +B Y +C Z +B Z +C Z +C Z +B X +B X +A Z +C Z +C Z +A X +B X +B X +A Y +C Z +A Z +A Y +B X +A Z +A Z +B X +A Z +C Z +B X +B Z +B Y +B X +A Y +C Z +C Z +C Z +A X +C Z +A Z +C Z +C Y +C Z +C Z +C Z +B X +A Z +B X +B Z +A Z +C Z +B Y +B Y +B Z +C Z +C Z +C Z +B Z +B Y +A Z +B X +B Z +C Z +A Z +B Y +B Y +A X +C Z +B Y +A Y +B Y +B X +B Y +B Y +A Y +B Y +C X +A Y +A Y +C Z +A Z +A Y +C Z +A Z +A Z +C Z +C Z +C Z +B X +B Y +A Y +A Y +B Z +A Z +B Y +B X +B Y +A Y +A Y +A Z +B Z +C Z +C Z +C Z +A Z +C Z +A Z +A Z +A Z +A Z +C Z +B Y +C Z +B X +C Z +A X +A Z +B X +C Y +C X +A X +A X +A Z +A Z +B X +A Y +B Z +A Z +B Z +A Z +C Z +C X +C Z +C Z +C X +C Z +C Z +C X +C Z +B Z +A Z +B Y +A Z +C Z +B X +C Z +B Z +B Y +A Z +B Y +A Y +B X +B Z +B Z +A Z +B Z +C Z +C Z +A Y +A Z +A X +A Y +C Z +B X +A Z +C X +A Z +A Z +A Z +A Z +C Y +B Y +B Y +A X +C Z +A X +A Z +A Y +C X +A Y +A Y +A Z +C X +C Z +B Z +B X +A Z +C Z +C Z +B Z +B X +C Z +C Z +A Y +B Z +A X +B Y +A Z +C X +B X +C Z +B Y +A X +A Z +B Y +A Y +A Z +B Z +A Y +B Y +A Z +B Y +B X +B Z +A Z +B Y +B Z +A Y +A Z +C Z +B X +C Z +B X +C Z +B Z +C Z +C Z +B Z +A Y +A Y +C Z +B Z +A Z +A X +C Z +A Z +C Z +A Z +A X +A Z +A Z +A Y +B Z +B X +C X +B Y +C Z +B X +B Z +B X +A Z +A Z +A Z +B Z +B Y +A Z +B Y +C Z +B Z +A Z +A Y +C Z +A Z +B Y +B X +B Y +B X +C Z +C Y +A Z +C Z +C Z +A Z +C X +B Z +A Y +B Y +B Y +B Y +C Z +B Z +A Z +B Y +A Z +A Z +C Z +B Y +B Y +A X +A Z +A Z +C Z +A Z +C Z +C Z +A X +B Z +A Z +A Z +C Z +C Z +B Y +B Y +A Z +A Y +A Z +B Y +B Z +A Y +B Z +A Z +A Z +A Y +C Z +A Y +C Z +B X +A Z +A Z +C Z +A Y +C Z +A Z +A Y +A Y +C Z +A Z +A Y +B X +A Y +B X +A Z +A Z +A Y +B Y +B Y +B X +C Z +C Z +B Y +B X +C Z +B Y +C Z +B Y +B X +C Z +A Y +B Z +C X +A Y +C Z +C Z +C X +A Y +A Z +B X +C Z +A Z +B Y +C Z +B X +B Z +C Z +C Z +C Z +A Z +B X +C Z +A Z +A Y +B Y +C Z +A X +C Z +A Y +C X +A Y +B Y +C Z +B X +A Z +C Z +C Z +B Z +B Y +A Z +A Z +A Y +C Z +A Y +A X +A Y +B Z +C Z +C Z +A Z +A Z +C Z +A Y +C Z +C Z +B Z +C Z +C Z +A Z +C Z +B Z +C Z +B X +A Y +A Y +A Z +C X +C Z +C Y +C Z +C Z +C Z +B Z +A Z +C Z +C Z +A Y +B Y +B X +B X +C Z +A Z +B Y +C Z +C Z +B X +C Z +C Z +A Y +A Y +A Z +A Y +B Y +C Z +A X +A Y +C Z +A Z +C Z +C Z +A X +A Z +C Z +B Z +A Z +A Z +B Y +B X +A Z +A Z +B Z +C Z +C Z +A Y +A Z +B Z +B Z +C Z +B Z +A Y +B X +A Z +B X +C Z +A Z +A Y +C Z +C Z +A Z +A Z +A Z +A Z +A Z +B X +C Z +C Z +C Z +A Z +A Z +A Z +A Z +B X +C Z +B X +C Z +A Z +C Z +A X +A Y +A Z +C Z +B Y +C Z +C Z +B Z +C Z +B X +C Z +B X +A Z +A Z +B Y +B X +C Z +C Z +C Z +C Y +C X +B Y +B Y +C Z +A Z +A Z +C Y +C Z +B Y +C X +A Z +B X +A Z +C Z +C Z +A Z +C X +A Z +B Z +B Y +A X +C Z +A Z +B X +A Z +B Y +C Z +B X +C Z +B Y +C Z +A X +C Z +A Z +C Z +A Y +A Y +C Z +C Z +B X +B Z +A Z +C Z +A Z +C Z +A Y +B X +C Z +A Z +B X +C Z +C Z +B Y +C Z +C Z +C Y +B Y +B X +C Z +B Y +A Z +A Z +B X +B Y +B Y +B Y +B Y +B Z +C Z +C Z +A Z +C Z +C X +C Z +B Z +C X +C X +A Z +A Z +B Y +B Z +B Y +C Z +A Y +A Z +B Y +B Y +B X +A Z +A Z +A Z +C Z +C Z +C Z +B Z +A X +A Z +A Y +C Z +A Z +A Z +B Z +B Y +B Y +A X +C Z +C Z +B X +A Z +B Y +A Z +B Z +A Z +C Z +C X +A Y +A Z +C Z +C Z +C Z +A Z +C Z +C Z +B Y +A Z +A Z +A Z +A Y +C Z +A Z +C Z +B Z +A Z +C Z +C X +B Z +C X +B X +C Z +B Z +A Y +C Z +C Z +B X +B Y +B Y +A Z +B X +A Y +A Y +A Z +B Z +C Z +C Z +B Z +A Z +C Z +B Y +C X +B Z +C Z +B Z +C Y +C Z +A Y +A Z +C Z +A Z +A Z +C Z +C Z +C Z +B Z +A Z +C Z +C X +A Z +A Z +B X +B Y +C Z +A Y +A Z +C Z +B Z +C Z +A Y +A Y +C Z +A Z +A Z +B X +A Y +B Y +C Z +C Z +B Y +A Z +A Y +C X +C Z +C Z +A Z +C Z +A Y +C Z +A Z +A Z +C Z +A Z +A X +C Z +C Z +A Z +B Z +B Z +B X +A Z +B X +A Y +A Z +C Z +C Z +A Y +B Z +C Z +A Z +A Z +C X +B Z +B Y +B Y +A Y +B X +B X +C Z +B X +A Z +B X +A Z +C Z +C Z +A Z +B Y +C Z +C X +C Z +C Z +A Z +B X +C Z +C Z +A Y +C Z +C Z +B X +B X +B X +A Z +B Y +C Z +A Z +C Z +C Z +B Y +C Z +A Z +C Z +B Y +B Z +C Z +C Z +C X +C Z +B Z +C Z +B Y +B X +A Z +A Y +B X +A Y +B Y +A Z +C Z +C Z +C Z +B X +C Z +B X +A Z +B X +B Y +A Z +C Z +C Z +C Z +A Y +B Y +A Y +C Z +A Z +C Z +C Z +A Z +A Y +C Z +B X +A Y +A Z +C Z +B Y +C Z +A Z +C Z +B Y +C Z +C Z +B Y +C Z +C Z +B X +C Z +B Y +C Z +B Y +A Z +C Z +B Y +A Z +C Z +C Z +B Y +B X +B Z +A Z +A Y +A Z +A Y +C Z +C Z +B X +C Z +B Y +C Z +C X +C Z +A Y +A Z +C Z +C Z +C Z +A Z +B Y +C Z +C Z +A Z +B Y +C Z +A Y +B Z +B X +A Y +B Y +C Z +A Y +C Z +B Y +B Y +C Z +C Z +B Y +B X +C Z +B X +B Z +B Y +C Z +C Z +C Z +A Z +A X +A Z +B Z +A Z +C Z +A Z +C Z +C Z +A Z +A Z +B Z +C Z +C Z +C Z +A Z +B Y +A Z +A Y +C Z +B X +B X +A Y +C Z +C Z +B X +B Z +C X +B X +B Y +A Z +A Y +A Z +C Z +B X +C Z +B Z +C Z +A Y +C Z +A Y +C Z +B Y +B Z +C Z +C Z +C Z +C Z +C Z +A Z +B Y +C Z +C X +B Y +C X +B Y +B Z +B Y +A Z +A Z +B X +C Y +A Z +C Z +B X +B X +A Z +A Z +B Y +C Z +B Y +B Z +A Y +A Z +C Z +C Z +B X +A Z +A Z +A Z +C Z +C X +C Z +C Z +C Z +C Z +A Z +B Y +C Z +C Z +C Z +B Z +C Z +B X +C Z +A Z +A Z +C Z +C Y +B Y +A Z +A Y +B Z +A Y +B Y +C Z +A Y +C Z +A Z +C Z +B X +C Z +A Z +A Z +B Z +A Z +B Z +A Z +B Y +C Z +B Z +B Y +C Z +A Z +A Z +B X +B X +A Y +A Z +B Y +A Y +A Z +C Z +A X +C Z +A Z +A Z +C Z +A Z +B X +A Z +A Y +A Y +B Y +A Z +A Z +A Z +B Y +B Y +A Z +A Z +C Z +C Z +A Y +B X +B X +C Z +A Y +C Z +C Z +C Z +A Y +C Z +C X +C Z +B Y +A Z +B Y +A Z +C Z +A Y +C Z +A Y +B Z +B X +B Y +B X +B Y +B X +A Y +C Z +C Z +B Z +C Z +C X +B X +A X +A Z +A Z +B Y +C Z +C Z +B Y +C Z +C Z +B Y +A Z +B Z +C X +C Z +C Z +B Y +C X +C Z +B Z +A Z +C Z +B X +A Z +C Z +A Z +C Z +B X +B Z +C Z +C Z +C Z +A Z +B Y +A Y +A Z +C Z +C Z +C Z +B Y +A Z +C Z +C Z +A Z +B Z +B Y +C Z +A Y +A Z +A Z +C Z +C Z +C Z +C Z +A Z +C Z +C Z +A Y +A Y +A Z +C Z +A Z +A Z +B X +A Y +A Z +A Y +C Z +B Z +A Y +A Z +B X +C Z +A Z +A Z +A Y +B Y +C Z +C Z +A Z +B X +A Y +A Z +C Z +C Z +B Y +C Z +A Z +B Y +C Z +C Z +B Y +C X +A Z +C Z +C Z +C Z +C Z +A Z +B Y +A Y +B Y +B Z +C Z +A Z +B Z +C Z +A X +C Z +C X +A Z +A Z +A X +A Z +A Z +A Z +A Z +B X +A Z +A Z +A Z +C Z +C Z +C Z +C Z +A Z +A Y +B X +C Z +B Y +A Y +A Z +C Z +C Z +C Z +B Y +A Z +B Z +C Z +B X +B Z +B Z +B Y +C Z +C X +B Y +A Y +C X +C Z +C Z +B Y +A Z +C Z +A Z +A Z +C Z +C Z +C Z +C Z +B Z +C Z +B X +C Z +B X +B Z +A Z +B Y +C Z +A Z +C Z +A Z +A Y +A Z +C Z +B X +C Z +C Z +A Z +A Z +C Z +C Z +A Z +C Z +A Y +C Z +C Z +A Z +A X +A Z +C Z +A Z +C Z +C Z +A Z +B X +C Z +C Z +C X +A Z +A Z +A X +B X +C Z +C Z +A Z +B X +C X +A Z +C Z +B Y +C Z +A Z +C Z +A Y +A Z +C Z +C Z +B X +A Z +B Y +A Z +C Z +C X +B Z +C Z +A X +A Y +C Z +C Z +C X +B Z +A Z +A Z +B Z +A Y +C X +A Z +C Z +A Z +C Z +A Z +A Z +A Z +C Z +A Z +C Z +B X +A Y +A Z +C Z +B Y +C Z +A Y +C Z +C Z +C Z +C Z +A Z +A Z +B Z +C Z +A Y +C X +C Z +C Y +B Y +C X +A Y +C Z +C Z +B Z +B Y +B Z +A Z +B Y +C Z +C Z +B X +B Y +B Z +A Z +A Z +C Z +B X +A Z +B Y +C Z +C Z +B X +C Z +A X +C Z +B X +A Y +A Z +B Y +C Z +C Z +A Y +A Z +C Z +C Z +A Z +C Z +C Z +C Z +B X +C Z +B Y +B Y +C Z +B Z +C Z +C X +C Z +B X +A Z +B Z +B Z +B Z +C Z +A X +C Z +B X +A Z +A Z +A Z +A Y +C Z +C Z +C Z +C X +A Y +A Z +A Z +C Z +C Z +A Z +B X +C Z +B Y +A X +C X +B Y +B Y +A Y +C X +C Z +B X +A Z +A Z +B Z +A Y +C Z +C Z +A Z +C Z +C Z +A Y +C Z +C Z +B Y +C Z +C Z +A Z +A Z +B Z +A Z +C Z +C Z +C Z +C X +C Z +A Z +C Z +C Z +C Z +C X +C Z +C Z +A Z +B Y +C Z +B X +A Z +C Z +C Y +A Z +A Y +A Z +C X +C X +A Y +B X +A Y +B Y +B Z +B Y +B Y +B Y +B Y +B Y +B Y +B Y +B X +B Z +A Y +A Y +A Y +B Y +A Y +B X +C X +A Z +C Z +A Z +A X +C Z +C Z +B Z +C Z +B Z +B Z +A Z +A Y +A Z +B X +B Z +C Y +A Z +A Z +A Z +C Z +C Z +C Z +C Z +A Z +C Y +A Y +C X +C Z +B Y +C Z +A Z +A X +A Z +B Z +C Z +B X +B X +A Z +C Z +B X +C Z +C Z +A X +C Z +A Z +C Z +C Z +B Z +B Y +B X +B Z +A X +A Y +C Z +A X +A Y +B Y +A Y +C Z +C Z +B X +C Z +B Z +C Z +B Y +C Z +A Z +A Y +B Z +B Z +A Z +A Z +A Z +A Y +C Z +C X +A Z +A X +B Y +B X +A Z +C Z +A Z +A Z +C Z +B Z +B Z +B Y +B Y +A Y +C Z +A Z +A Z +C Z +A Z +C Z +C Z +B X +B Y +C Z +C Z +B X +C X +C Z +A Y +C X +B X +A Z +A Z +A Y +B Y +A Z +B Z +C Z +C Z +A Z +B X +A X +B Y +A Z +B Z +A Z +B Y +C Z +A Z +A Y +C Z +A Y +C Z +C Z +A Z +C Z +C Z +A Z +A Y +C Z +A Z +B Z +A Y +A Z +C Z +C Z +A Y +C Z +A Y +A Z +C X +B X +B Z +B Z +B Z +B Z +B Y +B X +A Z +C Z +B Z +C Z +C Z +C X +A Z +A Z +B X +C Z +A Y +C Z +B Z +A Z +C X +C Z +C Z +B Y +C Z +B Z +A Z +A X +C Z +B X +A Z +B Y +C Y +C X +C Z +A Z +B Z +A Z +B Y +C Z +C Z +A Z +C Z +C Z +C Z +C Z +B Z +C Z +B X +B Y +A Z +B Y +B Y +A Z +C Z +C Z +B Y +B Y +B Y +B Y +B Z +B X +A Z +B Y +B X +A Z +A Y +B X +B X +C Z +C X +B Y +C Z +C Z +A Z +C X +C Z +A Z +B Y +A Z +A Z +A X +C Z +B Y +A Z +C Z +C Z +A Z +B Y +B Y +B Z +B Z +B X +A X +A Z +A Z +C X +B Y +A Y +B Z +A Z +B Y +C Z +C Z +B X +C Z +C Z +A Z +C Z +A Z +A Z +C Z +C Z +C Z +B X +B Z +A Y +B X +C Z +A Z +C Z +A Y +B Y +A X +C Z +A Y +A Z +A Z +A Z +B Z +C Z +C Z +C Z +C Z +C Z +B Z +B X +C Z +A Z +C Z +A X +B Z +C Z +C Z +A Z +A Z +B Y +C Z +A Z +C Z +B Y +A Z +A Y +A Y +C X +C Z +A Z +B Y +C Z +C X +C Z +A Y +A Z +A Z +B X +C Z +B X +B Y +A Y +A Y +B Z +A Y +A Z +B Z +A Z +A X +B Z +C Z +C X +C Z +C Z +C Z +C Z +C X +C Z +A Z +A Z +B X +A Z +A Z +A Z +C Z +A Z +C Y +B Y +B Y +C Z +A Y +B Z +C Z +C Z +C Z +A Z +C Z +A Z +B Z +B Y +A Y +C Z +A Z +A Y +C Z +C Z +A Y +B Y +C Z +A Z +A Y +A Z +B X +C X +C Z +C Z +A Y +A Z +B X +C Z +A Z +C Z +C Z +A Z +C Z +B X +A Z +A Z +B Y +C Z +B X +C Z +C X +A Z +B X +C X +C Z +C Z +A Z +B Y +A Y +C Z +B Z +B Y +C X +B X +C Z +C Y +A Z +A Z +C Z +B X +A Z +C Z +B Y +B X +B Z +B X +A Y +C Z +C Z +C Y +A Z +A Y +C Z +B X +A Z +A Z +B Z +B Z +B X +A Y +A Z +C Z +A Z +A X +A Y +C Z +C Z +B Y +A Z +C Z +B Z +A Z +B Y +C Z +B Y +A Z +B Z +A Z +B Y +B Z +C Z +C Z +A Y +C Z +A Z +B X +C Z +B X +B X +A Z +C Z +B Z +A Z +C Z +C Z +C Z +C Z +A Z +C Z +B Z +C Z +A Z +B X +C Z +A Z +C Z +C Z +A Y +A Y +C Z +A Y +A X +C Z +A Z +A Z +B Z +A Z +A X +C Z +B Y +A Y +B Y +A Y +C Z +C Z +B X +A Z +B X +B Z +B Z +A Y +C X +A Y +C Z +B Y +A Z +A Z +C Z +A Z +A Z +B Y +C X +B X +A Z +A X +C Z +A Z +B Y +A Z +C Z +C Z +A Z +B X +B Z +A X +A Y +A Y +B Y +B Z +B X +B Z +C X +B Z +C Z +C Z +B X +B Y +B X +B Z +B Z +C Z +A Z +A X +B X +C Z +A Z +B Y +B Y +C X +A Z +B X +A X +C Z +B Y +A Y +B Y +A Y +B Z +C Z +C Z +C Z +B Y +B Y +A Y +C Z +C Y +B Z +A Z +C Z +C Y +B X +B X +A Z +B Y +A Z +B X +A Z +B Y +B Y +C Z +C Z +A Z +B Y +C Z +C Y +C Z +C Z +A Y +B X +C Y +A Y +B X +C Z +C Z +C Z +B Z +B Y +A Z +A Y +A Z +C Z +C Z +B Y +C Z +C Z +A Z +B Z +C Z +A Z +A Z +A Z +A Y +C X +B Y +B Y +A Y +C Z +B Y +B X +B Z +C Z +C Z +A Y +A Z +A Z +B Z +C Z +C Z +B Y +C Z +A Z +C Z +C Z +C X +B X +B Y +C Z +A Z +A Y +C Z +C Z +C Z +A Z +A Y +C Z +A Z +A Y +A Y +C Z +B X +C Z +C X +B Y +A Z +B Y +C Z +B X +A Z +A Y +C Z +A Z +C Z +A Z +C Z +C Z +A Y +A Z +A Z +B Z +A Z +A Z +C Z +A X +A Y +C X +A Z +A Z +B Z +B Y +A Z +C Z +B Z +C Z +A Z +C Z +B X +C Z +B Z +B Z +C Z +B Z +A Z +A Z +C Z +A Z +C X +C Z +A Y +A Z +A X +A Z +B Z +B Z +C Z +C X +A Y +C Z +A Z +A Z +A X +C Z +C Z +C X +B Z +B X +B Z +B Y +C Z +A Z +A Y +A Y +B X +A Y +A Y +C Z +C Z +B Z +A Z +B Z +C Z +A Z +B Y +B Y +C Z +A Z +C Z +A Z +B Y +A Z +C Z +B X +C Z +A Z +C Z +A Y +B Y +A Y +B Z +A Y +C Z +A Z +C Z +B X +B X +B Y +B X +C Z +A X +B Y +B Z +C Z +A Y +C Z +B Z +C Z +A Z +C X +C Z +A Z +A Y +C Z +C Z +B Y +C Z +B Y +C Z +C Z +B Z +A Z +C Z +B Y +B X +A Z +C Z +C Z +A Z +C Z +C Z +B Y +A Z +B X +C Z +B Y +B X +A Z +C Z +A Z +C Z +A Z +C Z +B Y +C Z +A Z +B X +C Z +A Y +A Y +A Z +A Y +A Z +A X +C Z +B X +B Z +C Z +A Z +C X +A Z +A Z +A Z +C Z +A Z +C Z diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..c49d07b --- /dev/null +++ b/README.Rmd @@ -0,0 +1,144 @@ +--- +output: github_document +--- + +# Advent of Code Website Template + +Here's a template for making [Quarto](https://quarto.org) websites for working on and easy publishing [Advent of Code](https://adventofcode.com) solutions. + +It works hand-in-hand with the [**aochelpers**](https://ellakaye.github.io/aochelpers) package for R, +which makes it incredibly easy to set up new posts and listings, +using supplied (though personalisable) templates, found in the `_templates` directory. +When a template is copied by functions from **aochelpers**, +e.g. `aoc_new_year(2023)` or `aoc_new_day(1, 2023)` +any occurrence of "DD" and "YYYY" in both the template titles +and the text inside will be replaced with the value of the `day` +and `year` arguments respectively. + +The website corresponding to this template is , so you can see it in action there. + +## Templates +The `_templates` directory contains the following templates: + +- `post-template`, which contains `index.qmd` and `script.R`, which gets copied on calls to `aoc_new_day()` + - `index.qmd` is the template for writing up each day's solution. + It automatically provides correct links to the relevant puzzle on the Advent of Code website, as well as a link to your input + (assuming the input is in the same directory, which it will be if the post has been created with `aoc_new_day()`). + It also reads in the input using `aoc_input_vector()`, and notes alternative `aoc_input_*` functions if those are more appropriate for the day. + - `script.R` provides a place to work on your solutions, + before writing them up. +- `YYYY-intro`, which contains `index.qmd` is the template for an introductory post for each year. It gets copied by `aoc_new_year()` and is necessary for the website to render after a call to that function, but before any other posts are present (Quarto v1.4 onwards doesn't allow empty listings pages.) +- `YYYY.qmd` is the listing page for the year, which gets copied on a call to `aoc_new_year()` +- `_metadata.yml`, which gets copied by `aoc_new_year()`, sets the options for all the posts for the year. See [this page of the Quarto website](https://quarto.org/docs/projects/quarto-projects.html#shared-metadata) for more details. + +I've set up these templates in a way that I think works well, +but of course you can customise them to whatever you want for your version of the site. +**Don't rename them** though, otherwise the **aochelpers** functions won't be able to find them. Do use "DD" and "YYYY" wherever you want the actual value of the day and year to appear. + +## A note on directory structure and file names +The directory structure and file names have been set to echo the Advent of Code website. So, for example, the Day 1 puzzle for 2022 is at and the corresponding page on the template website is . Likewise, the input can be found at and respectively. (For your own version of the website, swap out the user name and repo name accordingly). + +## Using the website with **aochelpers** + +**aochelpers** can be installed from its [repo](https://github.com/EllaKaye/aochelpers): + +```{r eval=FALSE} +remotes::install_github("EllaKaye/aochelpers") +``` + +```{r} +library(aochelpers) +``` + +The two main functions for managing files, already mentioned above, are `aoc_new_year()` and `aoc_new_day()`. In the descriptions below, the `YYYY` and `DD` placeholders are used to indicate where the year and day values will be inserted. + +The calls used to create this template were: + +```{r example} +#| eval: false +# Add a listing page a directory for a new year +aoc_new_year() # set up current year +aoc_new_year(2022) # set up specified year + +# Add a post for a new day +aoc_new_day(1, 2022) # day 1 of 2022 (don't need to specify year for current year) + +# Get input for a day without greating a post +aoc_get_input(2, 2022) # day 2 of specified year +``` + +[`aoc_new_year()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_year.html) will + +- create a new directory for the specified year, at `./YYYY/`. +- create a new listing page for the year, as `./YYYY.qmd`. The listing page will be created using the template `./_templates/YYYY.qmd`. The listing page picks up posts from the `YYYY/day` directory. (This directory structure echoes the structure of the Advent of Code website.) +- optionally create an introductory post for the year, as `./YYYY/day/YYYY-introduction`, using the template `./_templates/YYYY-intro`. The post will be created only if the `intro` argument is `TRUE` (the default). Note that, as of Quarto v1.4, there needs to be at least one post in the `YYYY/day` directory for the website to render without error. +- if `_templates/_metadata.yml` exists, it will be copied to `./YYYY/day/_metadata.yml`. + +[`aoc_new_day()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_day.html) will + +- create a new directory for the specified day, at `./YYYY/day/DD/` +- copy the contents of `_templates/post-template` into the above directory +- download the puzzle input for the day from the Advent of Code website, and save it as `./YYYY/day/DD/input` (via a call to [`aoc_get_input()`)](https://ellakaye.github.io/aochelpers/reference/aoc_get_input.html) + +There are other functions for creating and deleting directories and files based on the advent-of-code-website-template. See the package [Reference](https://ellakaye.github.io/aochelpers/reference/index.html) page for details. + +## Examples posts +The template comes ready to go for 2023, +and also with an example introduction and day 1 post for 2022, +so you can see what the templates look in action. +All files related to 2022 can be removed with a call to `aoc_delete_year(2022)`. +The intro post for 2023 can be removed with `aoc_delete_intro(2023)` (once there's another post for 2023 present). + +## Functions for reading in input +**aochelpers** provides functions for reading in input in various ways. +The input for Day 2 of 2022 allows us to demonstrate all three: + +```{r} +aoc_input_vector(2, 2022) |> head() +aoc_input_data_frame(2, 2022) |> head() +aoc_input_matrix(2, 2022) |> head() +``` + +`aoc_input_vector()` and `aoc_input_matrix()` both have a `mode` argument that allow you to specify whether the input is character or numeric (defaults to character). `aoc_input_matrix()` by default has a new column for each single character/digit, though that can be changed with the `split` argument. +`aoc_input_data_frame()` can return either a `tbl_df` or `data.frame`. + +## Themes +The website template comes with two custom themes, one light and one dark. +The light theme is clean, with Christmas-y shades of green and red. +The dark theme is reminiscent of the Advent of Code website (though not identical, since the design of is part of its registered trademark). You can switch between them using the toggle in the top right corner of the page. +Both themes use [fonts from iA](https://github.com/iaolo/iA-Fonts). +The themes can be adapted in the `custom-light.scss` and `custom-dark.scss` files. +For more on Quarto themes, see the [documentation](https://quarto.org/docs/output-formats/html-themes.html). + +## Publishing +The template is set up with the option to publish automatically to GitHub pages, +using a GitHub action that activates on push to the main branch. +To allow this, when using the template, tick the box to 'include all branches', +which will then copy over the `gh-pages` branch as well. +If you do not wish to publish in this way, only copy the default branch, +and then you can delete the `.github` directory as well. + +For more information on the many options for publishing Quarto websites, +see the [documentation](https://quarto.org/docs/publishing/). + +## Examples +This template span out from my work on an Advent of Code website for myself, links below. +If anyone else uses this template and would like to share the links on this README, +please do submit a pull request to include it here, or raise an issue and I'll add it. +It would be great to get a collection. + +- Ella Kaye: [website](https://adventofcode.ellakaye.co.uk), [repo](https://github.com/EllaKaye/advent-of-code-website). + This version has substantially different theming to the template (to match my [personal site](https://ellakaye.co.uk)) and deploys manually to netlify (due to purchased, licensed fonts that I can't check into GitHub). + +## Other R Advent of Code projects +The project arose because my write-up of my 2020 solutions as one long blog post was too unwieldy. +I was inspired by Emil Hvitfledt's [R Advent of Code](https://emilhvitfeldt.github.io/rstats-adventofcode/) website, +which has a separate page for each year, +though his site uses a tabset for the different days, +whereas this one has a separeate listing page for each year, then separate posts for each day. + +**aochelpers** adapts and builds upon code from David Robinson's [adventdrob](https://github.com/dgrtwo/adventdrob) package. His package contains other functions for working with Advent of Code input that he has found useful when approaching the challenges over the years. + +TJ Mahr has an [**aoc**](https://github.com/tjmahr/aoc) package that provides [usethis](https://usethis.r-lib.org)-style functions for Advent fo Code puzzles. +It takes a different approach to **aochelpers** by organising everything within the structure of an R package, +with a new package for each year. diff --git a/README.md b/README.md index 1e86320..130d7df 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,242 @@ -# advent-of-code-website-template -Work-in-progress template for making [Quarto](https://quarto.org) websites for working on and publishing [Advent of Code](https://adventofcode.com) solutions. \ No newline at end of file + +# Advent of Code Website Template + +Here’s a template for making [Quarto](https://quarto.org) websites for +working on and easy publishing [Advent of +Code](https://adventofcode.com) solutions. + +It works hand-in-hand with the +[**aochelpers**](https://ellakaye.github.io/aochelpers) package for R, +which makes it incredibly easy to set up new posts and listings, using +supplied (though personalisable) templates, found in the `_templates` +directory. When a template is copied by functions from **aochelpers**, +e.g. `aoc_new_year(2023)` or `aoc_new_day(1, 2023)` any occurrence of +“DD” and “YYYY” in both the template titles and the text inside will be +replaced with the value of the `day` and `year` arguments respectively. + +The website corresponding to this template is +, so you can +see it in action there. + +## Templates + +The `_templates` directory contains the following templates: + +- `post-template`, which contains `index.qmd` and `script.R`, which gets + copied on calls to `aoc_new_day()` + - `index.qmd` is the template for writing up each day’s solution. It + automatically provides correct links to the relevant puzzle on the + Advent of Code website, as well as a link to your input (assuming + the input is in the same directory, which it will be if the post has + been created with `aoc_new_day()`). It also reads in the input using + `aoc_input_vector()`, and notes alternative `aoc_input_*` functions + if those are more appropriate for the day. + - `script.R` provides a place to work on your solutions, before + writing them up. +- `YYYY-intro`, which contains `index.qmd` is the template for an + introductory post for each year. It gets copied by `aoc_new_year()` + and is necessary for the website to render after a call to that + function, but before any other posts are present (Quarto v1.4 onwards + doesn’t allow empty listings pages.) +- `YYYY.qmd` is the listing page for the year, which gets copied on a + call to `aoc_new_year()` +- `_metadata.yml`, which gets copied by `aoc_new_year()`, sets the + options for all the posts for the year. See [this page of the Quarto + website](https://quarto.org/docs/projects/quarto-projects.html#shared-metadata) + for more details. + +I’ve set up these templates in a way that I think works well, but of +course you can customise them to whatever you want for your version of +the site. **Don’t rename them** though, otherwise the **aochelpers** +functions won’t be able to find them. Do use “DD” and “YYYY” wherever +you want the actual value of the day and year to appear. + +## A note on directory structure and file names + +The directory structure and file names have been set to echo the Advent +of Code website. So, for example, the Day 1 puzzle for 2022 is at + and the corresponding page on the +template website is +. +Likewise, the input can be found at + and + +respectively. (For your own version of the website, swap out the user +name and repo name accordingly). + +## Using the website with **aochelpers** + +**aochelpers** can be installed from its +[repo](https://github.com/EllaKaye/aochelpers): + +``` r +remotes::install_github("EllaKaye/aochelpers") +``` + +``` r +library(aochelpers) +``` + +The two main functions for managing files, already mentioned above, are +`aoc_new_year()` and `aoc_new_day()`. In the descriptions below, the +`YYYY` and `DD` placeholders are used to indicate where the year and day +values will be inserted. + +The calls used to create this template were: + +``` r +# Add a listing page a directory for a new year +aoc_new_year() # set up current year +aoc_new_year(2022) # set up specified year + +# Add a post for a new day +aoc_new_day(1, 2022) # day 1 of 2022 (don't need to specify year for current year) + +# Get input for a day without greating a post +aoc_get_input(2, 2022) # day 2 of specified year +``` + +[`aoc_new_year()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_year.html) +will + +- create a new directory for the specified year, at `./YYYY/`. +- create a new listing page for the year, as `./YYYY.qmd`. The listing + page will be created using the template `./_templates/YYYY.qmd`. The + listing page picks up posts from the `YYYY/day` directory. (This + directory structure echoes the structure of the Advent of Code + website.) +- optionally create an introductory post for the year, as + `./YYYY/day/YYYY-introduction`, using the template + `./_templates/YYYY-intro`. The post will be created only if the + `intro` argument is `TRUE` (the default). Note that, as of Quarto + v1.4, there needs to be at least one post in the `YYYY/day` directory + for the website to render without error. +- if `_templates/_metadata.yml` exists, it will be copied to + `./YYYY/day/_metadata.yml`. + +[`aoc_new_day()`](https://ellakaye.github.io/aochelpers/reference/aoc_new_day.html) +will + +- create a new directory for the specified day, at `./YYYY/day/DD/` +- copy the contents of `_templates/post-template` into the above + directory +- download the puzzle input for the day from the Advent of Code website, + and save it as `./YYYY/day/DD/input` (via a call to + [`aoc_get_input()`)](https://ellakaye.github.io/aochelpers/reference/aoc_get_input.html) + +There are other functions for creating and deleting directories and +files based on the advent-of-code-website-template. See the package +[Reference](https://ellakaye.github.io/aochelpers/reference/index.html) +page for details. + +## Examples posts + +The template comes ready to go for 2023, and also with an example +introduction and day 1 post for 2022, so you can see what the templates +look in action. All files related to 2022 can be removed with a call to +`aoc_delete_year(2022)`. The intro post for 2023 can be removed with +`aoc_delete_intro(2023)` (once there’s another post for 2023 present). + +## Functions for reading in input + +**aochelpers** provides functions for reading in input in various ways. +The input for Day 2 of 2022 allows us to demonstrate all three: + +``` r +aoc_input_vector(2, 2022) |> head() +``` + + ## [1] "A X" "B Y" "B Y" "C X" "B X" "C Z" + +``` r +aoc_input_data_frame(2, 2022) |> head() +``` + + ## # A tibble: 6 × 2 + ## X1 X2 + ## + ## 1 A X + ## 2 B Y + ## 3 B Y + ## 4 C X + ## 5 B X + ## 6 C Z + +``` r +aoc_input_matrix(2, 2022) |> head() +``` + + ## [,1] [,2] [,3] + ## [1,] "A" " " "X" + ## [2,] "B" " " "Y" + ## [3,] "B" " " "Y" + ## [4,] "C" " " "X" + ## [5,] "B" " " "X" + ## [6,] "C" " " "Z" + +`aoc_input_vector()` and `aoc_input_matrix()` both have a `mode` +argument that allow you to specify whether the input is character or +numeric (defaults to character). `aoc_input_matrix()` by default has a +new column for each single character/digit, though that can be changed +with the `split` argument. `aoc_input_data_frame()` can return either a +`tbl_df` or `data.frame`. + +## Themes + +The website template comes with two custom themes, one light and one +dark. The light theme is clean, with Christmas-y shades of green and +red. The dark theme is reminiscent of the Advent of Code website (though +not identical, since the design of is part of +its registered trademark). You can switch between them using the toggle +in the top right corner of the page. Both themes use [fonts from +iA](https://github.com/iaolo/iA-Fonts). The themes can be adapted in the +`custom-light.scss` and `custom-dark.scss` files. For more on Quarto +themes, see the +[documentation](https://quarto.org/docs/output-formats/html-themes.html). + +## Publishing + +The template is set up with the option to publish automatically to +GitHub pages, using a GitHub action that activates on push to the main +branch. To allow this, when using the template, tick the box to ‘include +all branches’, which will then copy over the `gh-pages` branch as well. +If you do not wish to publish in this way, only copy the default branch, +and then you can delete the `.github` directory as well. + +For more information on the many options for publishing Quarto websites, +see the [documentation](https://quarto.org/docs/publishing/). + +## Examples + +This template span out from my work on an Advent of Code website for +myself, links below. If anyone else uses this template and would like to +share the links on this README, please do submit a pull request to +include it here, or raise an issue and I’ll add it. It would be great to +get a collection. + +- Ella Kaye: [website](https://adventofcode.ellakaye.co.uk), + [repo](https://github.com/EllaKaye/advent-of-code-website). This + version has substantially different theming to the template (to match + my [personal site](https://ellakaye.co.uk)) and deploys manually to + netlify (due to purchased, licensed fonts that I can’t check into + GitHub). + +## Other R Advent of Code projects + +The project arose because my write-up of my 2020 solutions as one long +blog post was too unwieldy. I was inspired by Emil Hvitfledt’s [R Advent +of Code](https://emilhvitfeldt.github.io/rstats-adventofcode/) website, +which has a separate page for each year, though his site uses a tabset +for the different days, whereas this one has a separeate listing page +for each year, then separate posts for each day. + +**aochelpers** adapts and builds upon code from David Robinson’s +[adventdrob](https://github.com/dgrtwo/adventdrob) package. His package +contains other functions for working with Advent of Code input that he +has found useful when approaching the challenges over the years. + +TJ Mahr has an [**aoc**](https://github.com/tjmahr/aoc) package that +provides [usethis](https://usethis.r-lib.org)-style functions for Advent +fo Code puzzles. It takes a different approach to **aochelpers** by +organising everything within the structure of an R package, with a new +package for each year. diff --git a/index.qmd b/index.qmd index 2cdf4a9..a732c42 100644 --- a/index.qmd +++ b/index.qmd @@ -17,7 +17,7 @@ and will eventually include functions to help with the challenges themselves. Se As part of the demo, this template comes with an example listing page and some example posts for 2022, which you can delete with `aochelpers::aoc_delete_year(2022)`, as well as a listing and introduction to get started for 2023. -There are two built-in themes. The light theme is designed to be quite clean, with a Christmas green and red colours. The dark theme is designed to be reminiscent of the Advent of Code website (though not identical, since the design of is part of its registered trademark). You can switch between them using the toggle in the top right corner of the page. +There are two built-in themes. The light theme is designed to be quite clean, with a Christmas green and red colours. The dark theme is designed to be reminiscent of the Advent of Code website (though not identical, since the design of is part of its registered trademark). You can switch between them using the toggle in the top right corner of the page. Both themes use [fonts from iA](https://github.com/iaolo/iA-Fonts). The themes can be adapted in the `custom-light.scss` and `custom-dark.scss` files.