Skip to content

Indivicivet/AoC2022

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AoC2022

this year I am going to try to have fun. :)

Calendar

reverse lookup (by language / method)

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

Solutions

Day 1

python with some arithmetic in brainfuck

python code

brainfuck "sum chunks" for part 1

brainfuck "add 3 numbers"...

Day 2

by hand in google docs/calculator

part 1 ctrl-f for X, Y, Z, A X etc part 2 ctrl-f for A X, A Y, etc

Day 3

3-1

in godot: pass the left half and right half of the background through each other, increasing the score whenever a collision happens. make a big explosion upon collision to remove duplicates

godot project

part 1: lots of black boxes with letters, long orange rectangles and a score counter

3-2

in python, code golfed to 95 bytes (loads a file called "3" in the same directory; there's a setup batch script to copy that from the inputs folder)

python file

Day 4

4-1

work in progress: python + brainfuck

Day 5

todo

Day 6

by hand with pen + paper

part 1: dots under the first many letters, column count and calculations on the side

part 2: messy lines under letters in the middle, incorrect + correct calculations on the side

Day 7

python (writing to/querying the filesystem, of course; only tested on windows)

python code

Day 8

wip...

Day 9

in (the rather nice, I think?) noulith language by betaveros, the Advent of Code (current) #1 ranked user. their webpage / their github

part 1

part 2 which does act as a generalization of part 1, but also has slightly less clean code

Day 10

in python and very boring, although at least I define sensible classes? python code

Day 11

11-1

in python and C++ via cppyy, which lets you create runtime python / C++ bindings.

the python file does most of the work: parse the input, run the rounds, and define the logic for the monkeys that multiply worry level (MultMultMonkeys). the logic for the monkeys that add to worry level are implemented in the C++ file.

Day 12

by hand with pen + paper

day 12: areas to avoid blocked off, path highlighted, various tickmarks for counting the path length

the right/finish section is navigating up a spiral of all letters, and I did this first, to get to d/e -- there is only one d/e area you can get to. I did this first, and it tells you where you have to aim for. the left/start section is just navagating a sea of c's; you can never drop into an a-hole because there are no b's to get back out. the route is super simple once you block off all the a's (ignore the part where I made a mistake...).

I had an off-by-two error which I fixed by going via z at the end, although the problem statement says that's the same elevation as the end point... I'm not sure how else I managed to create a shorter route :/

the second part is very easy. you only have to pick the optimal starting "a" point from the far left column, since there are no b's other than in the second column. you can then read off how many vertical steps you skipped by comparing to the start point and subtract that from the part 1 answer.

Day 13

just plain python. trying to make it look easy since python almost solves this question out of the box, just not quite... python code

Day 16

by hand on pen + paper, using a spreadsheet for the actual value calculations

16-1

first draw out all of the valves and tunnels...

messy page with many two-letter valve names and connecting lines

then find the links between the valves you actually care about (ones with flow rate > 0; the majority of valves are flow rate 0 and just act as intermediate points)...

the same page but with nonzero flow rate valves circled in green, and connected to each other in orange

redraw just the nonzero flow rate valves (and distances) on a new page, highlight the 20+ and 10+ flow rate valves, scribble some candidate paths...

a neater page showing a graph with fewer links, where high-value nodes are highlighted

at this point there were three obvious candidate paths: two ways of rushing straight to a long chain of high values, and another way which gets a couple of very high values quickly but requires doubling back on yourself. I calculated the resulting score for these three paths with a spreadsheet:

spreadsheet calculating the score from magnitudes and times, with a section for each candidate path

Reverse Lookup

days by language / method / etc

godot

python + brainfuck

python + C++

python (gode colfed)

just python...

noulith

this is the language noulith written by betaveros, the Advent of Code (current) #1 ranked user. their webpage / their github

google docs

  • day 2 in google docs (+google calculator)

pen + paper

  • day 6 by hand with pen + paper
  • day 12 by hand with pen + paper (+ highlighter)
  • day 16 pen + paper, plus a spreadsheet for actual value calculations

About

this year I am going to try to have fun. :)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published