adventofcode

module
v0.0.0-...-13cd2e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: MIT

README

Advent of Code

Repository with my solutions of Advent of Code programming puzzles.

Usage

I restrict myself to use of Go standard library (and sometimes exp). All solutions are meant as standalone binaries that read input from stdin and print usually 2 lines (solutions of part 1 and 2) to the stdout.

To run any of the solutions do simply run: cat ./YYYY/DD/test.txt | go run ./YYYY/DD

Disclaimer

These solutions are only as good so I can call it a (solved) day. They are absolutely not a showcase of my skills nor a good learning material. I do this for fun and joy during my lunchbreaks as the new puzzles pop up at 2PM JST.

Christmas tend to be a bit hectic in general (I am a married man, an expat living 8000km away from relatives and a fresh dad); so excuse me for brute force, unhandled corner cases, poor parsing of input or false assumption here and there.

Have a Merry Christmas and Happy New Year!

Directories

Path Synopsis
2022
01
02
03
04
05
06
07
08
09
10
Read input from stdin, interpret the instructions; oputput sum of signal strengths at given cycle counts and render 40px scanlines.
Read input from stdin, interpret the instructions; oputput sum of signal strengths at given cycle counts and render 40px scanlines.
11
12
13
14
15
16
17
18
Read input from stdin.
Read input from stdin.
19
20
21
22
23
24
25
2023
01
02
Parse each line as game, produce sum of possible game ids and sum of minimum power of minimum cube numbers.
Parse each line as game, produce sum of possible game ids and sum of minimum power of minimum cube numbers.
03
Find sum of all numbers adjacent (diagonally too) to non '.' characters and sum of all gear ratios (2 numbers adjacent to '*' multiplied).
Find sum of all numbers adjacent (diagonally too) to non '.' characters and sum of all gear ratios (2 numbers adjacent to '*' multiplied).
04
Find sum of points of winning cards in original deck and count all cards in won cards deck.
Find sum of points of winning cards in original deck and count all cards in won cards deck.
05
Parse almanac and find lowest seed destination.
Parse almanac and find lowest seed destination.
06
Find multiplication of record beating attempts for three rides and number of ways to beat final race.
Find multiplication of record beating attempts for three rides and number of ways to beat final race.
07
08
Find number of steps from AAA to ZZZ and from all **A to all **Z.
Find number of steps from AAA to ZZZ and from all **A to all **Z.
09
Find sums of extrapolated history numbers on right and left side of dataset.
Find sums of extrapolated history numbers on right and left side of dataset.
10
Find half of length of the loop and number of contained tiles in it.
Find half of length of the loop and number of contained tiles in it.
11
12
Find sum of valid arrangements of working and non-working springs according to given stencil.
Find sum of valid arrangements of working and non-working springs according to given stencil.
13
Find reflection line in given pattern either without smudge or with one smudge.
Find reflection line in given pattern either without smudge or with one smudge.
14
Find board load after tilting north once and after 1000000000 all direction tilts.
Find board load after tilting north once and after 1000000000 all direction tilts.
15
Find sum of step hashes and sum of lens powers.
Find sum of step hashes and sum of lens powers.
16
Find number of lightbeam energized tiles, find maximum possible energized tiles possible when starting from any edge tile.
Find number of lightbeam energized tiles, find maximum possible energized tiles possible when starting from any edge tile.
17
Find most heat-loss eficient path for up to 3 consecutive straight moves and for no less than 4 but up to 10 consecutive straight moves.
Find most heat-loss eficient path for up to 3 consecutive straight moves and for no less than 4 but up to 10 consecutive straight moves.
18
Find area of polygon given as set of direction + length plotting instructions.
Find area of polygon given as set of direction + length plotting instructions.
19
20
Simulate circuit and find number of high and low signals after 1000 button presses; find number of button presses needed to get rx low.
Simulate circuit and find number of high and low signals after 1000 button presses; find number of button presses needed to get rx low.
21
Find number of covered garden plots given the number of steps.
Find number of covered garden plots given the number of steps.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL