View all by riv
riv
Follow riv
Follow
Following riv
Following
Add To Collection
Collection
Devlog
aoc 2020
←
Return to aoc 2020
Devlog
day 23
December 23, 2020
by
riv
#23
ok so.. 23a i just did with a list, and 23b i changed that to a dict which was effectively a linked list (cups[i] = j <=> cup j is clockwise of cup i) '23a - dict' is my 23b solution applied to a, '2...
Continue reading
day 22
December 22, 2020
by
riv
#22
v little commentary bc it's crunch time for my mod 22a, featuring a dict to make reading in a bit more general before i go and hardcode two players anyway: # input with open('22.txt', 'r') as file: in...
Continue reading
day 21
December 21, 2020
by
riv
#21
today's one was so much nicer! and the code ran super quickly (at least from a human point of view). each line this time has a list of ingredients (separated by spaces) followed by the allergens as '(...
Continue reading
day 20
December 20, 2020
by
riv
#20
yesterday's one straight-up murdered me because my brain was so foggy and i have zero experience in formal languages - i've put up my working solutions but there's no chance i'm going to explain it lm...
Continue reading
day 18
December 18, 2020
by
riv
#18
today's puzzle is doing maths with a different order of operations usual input stuff: # input with open('18.txt', 'r') as file: input = file.read() # turn the input into a list input_list = list(input...
Continue reading
day 17
December 17, 2020
by
riv
#17
*slams fists on table* more cellular automata but in 3D (...and in 4D)!! i'm really glad i didn't have much to do today so i could just take a chill day and work on this problem a lot of people did th...
Continue reading
day 16
December 16, 2020
by
riv
#16
what. a. day. the input has a few sections: the rules for each field, a blank line, 'your ticket:', the values on your ticket, another blank line, 'nearby tickets:', and then the remaining lines are a...
Continue reading
day 15
December 15, 2020
by
riv
#15
well this was a weird day... my main struggle was just making basic errors. the input isn't even on a separate page and it's only one line with numbers separated by commas, so i took out my input.spli...
Continue reading
day 14
December 14, 2020
by
riv
#14
the input for this is a list of bitmasks followed by memory locations and values to put in those locations (after the appropriate masks are applied). for both parts we start off by just reading in the...
Continue reading
day 13
December 13, 2020
by
riv
#13
ah yes, we love buses. i am incredibly grateful that every number involved in this was a distinct prime since i went for a highly mathematical solution (i don't know how efficiently it's implemented,...
Continue reading
day 12
December 12, 2020
by
riv
#12
it's turtle time - part a is effectively getting a turtle to walk around in https://turtleacademy.com/ . the input is a sequence where each line is a letter (N/E/S/W to move in that cardinal directio...
Continue reading
day 11
December 11, 2020
by
riv
#11
did someone say cellular automata?? i've been interested in them ever since i heard about conway's game of life (RIP John Conway), so i had the conceptual background for today's puzzle at least both p...
Continue reading
day 10
December 10, 2020
by
riv
#10
so... this was a new record for the number of incorrect submissions, and one potential solution that has been described as "O(heat-death-of-the-universe)" because my first approach for part b was incr...
Continue reading
day 9
December 09, 2020
by
riv
#9
this one was a LOT nicer for my mathematical brain lol - 9b.py solves both problems, so i'm gonna talk about the code in that starts off with the usual reading the file in and setting stuff up (each l...
Continue reading
day 7
December 07, 2020
by
riv
#7
this was the hardest one so far but it was one of the most fun! the main issue is trying to implement a directed tree - i ended up doing this through dicts (technically defaultdicts, so that i could s...
Continue reading
day 6
December 06, 2020
by
riv
#6
chrome decided that my input was in Polish lmao, had to make sure I didn't end up with silence and and and and ... heartache 6a.py splits the input up into groups, and then for each group it takes the...
Continue reading
day 5
December 05, 2020
by
riv
#5
5a.py goes through the list of seats, converts them to binary strings (from the description, F/L is a 0 and B/R is a 1), converts these to an int, and then saves this ID if it is larger than the large...
Continue reading
day 4
December 04, 2020
by
riv
#4
4b.py (solves both problems, some comments removed bc they were annoying me): # Passport data is validated in batch files (your puzzle input). # Each passport is represented as a sequence of key:value...
Continue reading
day 3
December 04, 2020
by
riv
#3
3a.py # Starting at the top-left corner of your map and following a slope of right 3 and down 1, # how many trees would you encounter? # the same pattern repeats to the right many times # input with o...
Continue reading
day 2
December 04, 2020
by
riv
#2
2a.py # Each line gives the password policy and then the password. # The password policy indicates the lowest and highest number of times a given letter # must appear for the password to be valid. # F...
Continue reading
day 1
December 04, 2020
by
riv
#1
1a.py # find the two entries that sum to 2020 and then multiply those two numbers together # input with open('1.txt', 'r') as file: input = file.read() # turn the input into a list list_str = list...
Continue reading