Categorygithub.com/danvolchek/AdventOfCode
repository
0.0.0-20231205072204-fe39ab5e75d9
Repository: https://github.com/danvolchek/adventofcode.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

Advent of Code

This repo contains my solutions to the Advent of Code puzzles.

Solution format

<year>
 └───<day>
     ├───leaderboard
     │   ├───1
     │   └───2
     └───optimized
         ├───1
         └───2
DirectoryMeaning
yearHolds solutions for all puzzles in that year.
dayHolds solutions for all puzzles on that day.
leaderboardA quick attempt at the puzzle to try to get onto the leaderboards.
optimizedThe end result of optimizing the solution. Primarily for readability, secondarily for time/space complexity.
1Solution to the first part of the puzzle.
2Solution to the second part of the puzzle.

Notes

Running

The working directory needs to be the root folder of the repository, i.e. AdventOfCode, to run both solutions and scripts.

Organization

Each day is partitioned into leaderboard and optimized solutions. The optimized solution usually builds on top of the leaderboard solution.

Each part of each solution is partitioned into its own folder, where only that part is solved.

Scripts

Generating new solution directories

go run cmd/template/main.go without arguments (or make template) will infer which directory to generate by looking at the last completed puzzle and generating the next one. E.g. if 2021/5/leaderboard exists, it'll generate 2021/5/optimized. Once that exists, it'll generate 2021/6/leaderboard, and so on.

When inferring arguments, solutions to skip can be specified through skip.txt. Each line is of the format year/day # optional comment, and if day is omitted the entire year is skipped. year or day can either be a single number num, or a range like num-num to exclude multiple values.

The arguments can be provided through the command line as well. See go run cmd/template/main.go --help for argument info.

Updating the completion tables

go run cmd/readme/main.go (or make readme) will update the completion tables below based on the directory structure of the repository. It takes no arguments.

Doing both

make will infer a new day, create it, and then update the readme.

Running tests

make test will run tests on the command scripts.

Completion

2023

12345678910111213141516171819202122232425
leaderboard1,21,21,21,21,2
optimized1,21,21,21,2

2022

12345678910111213141516171819202122232425
leaderboard1,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21
optimized1,21,21,21,21,21,21,21,21,21,21,21,21,21,21,2

2021

12345678910111213141516171819202122232425
leaderboard1,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21
optimized1,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21

2020

12345678910111213141516171819202122232425
leaderboard1,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21
optimized1,21,21,21,21,21,21,21,21,21,21,21,21,21,2111,21

2019

12345678910111213141516171819202122232425
leaderboard1,21,21,21,2
optimized1,2222

2016

12345678910111213141516171819202122232425
leaderboard1,2
optimized

2015

12345678910111213141516171819202122232425
leaderboard1,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,2
optimized