Skip to content

shnako/advent-of-code-2023

Repository files navigation

Advent of Code 2023 🎄

I tried to make the code as clean and easy to read as possible, and I've also provided a short explanation to most solutions so that they're easier to understand.

Day Puzzle Solution Results Input Text
01 Trebuchet?! Day 01 solution Day 01 test Day 01 input Day 01 puzzle
02 Cube Conundrum Day 02 solution Day 02 test Day 02 input Day 02 puzzle
03 Gear Ratios Day 03 solution Day 03 test Day 03 input Day 03 puzzle
04 Scratchcards Day 04 solution Day 04 test Day 04 input Day 04 puzzle
05 If You Give A Seed A Fertilizer Day 05 solution Day 05 test Day 05 input Day 05 puzzle
06 Wait For It Day 06 solution Day 06 test Day 06 input Day 06 puzzle
07 Camel Cards Day 07 solution Day 07 test Day 07 input Day 07 puzzle
08 Haunted Wasteland Day 08 solution Day 08 test Day 08 input Day 08 puzzle
09 Mirage Maintenance Day 09 solution Day 09 test Day 09 input Day 09 puzzle
10 Pipe Maze Day 10 solution Day 10 test Day 10 input Day 10 puzzle
11 Cosmic Expansion Day 11 solution Day 11 test Day 11 input Day 11 puzzle
12 Hot Springs Day 12 solution Day 12 test Day 12 input Day 12 puzzle
13 Point of Incidence Day 13 solution Day 13 test Day 13 input Day 13 puzzle
14 Parabolic Reflector Dish Day 14 solution Day 14 test Day 14 input Day 14 puzzle
15 Lens Library Day 15 solution Day 15 test Day 15 input Day 15 puzzle
16 The Floor Will Be Lava Day 16 solution Day 16 test Day 16 input Day 16 puzzle
17 Clumsy Crucible Day 17 solution Day 17 test Day 17 input Day 17 puzzle
18 Lavaduct Lagoon Day 18 solution Day 18 test Day 18 input Day 18 puzzle
19 Aplenty Day 19 solution Day 19 test Day 19 input Day 19 puzzle
20 Pulse Propagation Day 20 solution Day 20 test Day 20 input Day 20 puzzle
21 Step Counter Day 21 solution Day 21 test Day 21 input Day 21 puzzle
22 Sand Slabs Day 22 solution Day 22 test Day 22 input Day 22 puzzle
23 A Long Walk Day 23 solution Day 23 test Day 23 input Day 23 puzzle
24 Never Tell Me The Odds Day 24 solution Day 24 test Day 24 input Day 24 puzzle
25 Snowverload Day 25 solution Day 25 test Day 25 input Day 25 puzzle

Structure

The corresponding files for each solution are grouped within a dayXX package. Each package contains:

  • Solution.java: my implementation of the solution to the puzzle
  • puzzle.txt: a dump of the puzzle text from the website, with the source link at the top
  • input.txt: the puzzle input I received

Each solution extends the SolutionBase interface and must implement the runPart1 and runPart2 methods which return the result as a string.

Each test implements the SolutionBaseTest interface and must specify the expected results in the test assertions.

Running

All solutions via tests

You can run all the tests using gradle:

./gradlew test

or if you're using Windows:

gradlew.bat test

Individual solutions via main

You can also take advantage of the functionality implemented in Main.java to run the puzzles individually:

./gradlew run --args='<day> <part>'

or if you're using Windows:

gradlew.bat run --args="<day> <part>"

replacing <day> with the puzzle's day number and <part> with either 1 or 2, or 0 to run both parts.

Running without the arguments will prompt you to enter them.

Results

Dashboard

Advent of Code 2023 Dashboard Result

Company Leaderboard

Anonymized Private Company Leaderboard