🎄 Advent of Code 2024

Solutions for Advent of Code in Go.

2024 Results

Day Part 1 Part 2
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
Day 9
Day 10
Day 11
Day 12
Day 13
Day 14
Day 15
Day 16
Day 17
Day 18
Day 19
Day 20
Day 21
Day 22
Day 23
Day 24
Day 25

Benchmarks

Day Part 1 Part 2
Day 1 192.328µs 277.442µs
Day 2 271.722µs 668.116µs
Day 3 355.281µs 700.291µs
Day 4 1.310ms 1.251ms
Day 5 546.704µs 680.442µs
Day 6 187.472µs 24.040ms
Day 7 2.406ms 4.369ms
Day 8 37.147µs 54.927µs
Day 9 302.286µs 55.452ms
Day 10 1.050ms 162.316µs
Day 11 7.602ms 7.479µs
Day 12 967.359µs 1.036ms
Day 13 359.420µs 110.144µs
Day 14 887.116µs 147.532ms
Day 15 537.784µs 1.055ms
Day 16 7.426ms 15.831ms
Day 17 7.749µs 169.068µs
Day 18 3.490ms 6.408ms
Day 19 10.162ms 31.491ms
Day 20 4.910ms 148.379ms
Day 21 180.354µs 1.261ms
Day 22 24.790ms 42.216ms
Day 23 903.638µs 50.046ms
Day 24 174.295µs 159.264µs
Day 25 533.876µs -

Total: 602.947ms


Template readme

AOCgen

AOCgen is a tool to assist in solving Advent of Code in Go. This is a heavily modified fork.

Setup

You need to set up aoc-cli in order to download input and making submissions automatically.

Run AOCgen via executable: ./aocgen

Commands

  • bench: run benchmarks for a given puzzle or year of puzzles
  • build: run code generation suite, useful for when you've had to remove any code
  • gen: generate a puzzle
  • input: display input for a puzzle in the console
  • list: list all years or puzzles in a year
  • rm: delete a puzzle and its input
  • run: run a puzzle

Generating Code

Use aocgen via the gen subcommand to generate code: ./aocgen gen -y <year> -d <day>

This will generate two files: the puzzle (pkg/year<year>/<day>.go) and its input (pkg/year<year>/inputs/<day>.txt)

Open up the puzzle and remove the DO NOT EDIT line to begin working.

Run the puzzle through the aocgen command as well: ./aocgen run -y <year> -d <day>

Benchmarking

Again, use aocgen to run benchmarks for a specific day's puzzle or the entire year:

Day: ./aocgen bench -y <year> -d <day>

Year: ./aocgen bench -y <year>