Skip to main content

C'est la Z

Tag: emacs

Final thoughts on Advent of Code 2020

Time for some final thoughts on Advent of Code 2020. This was my sixth Advent of Code but the first time I completed all 25 days. Better than last year's 31 and a whole lot better than my weakest effort of 11 stars in 2017. I managed to find the time to finish all but two on the day they were released and finished those two on Christmas morning.
# COMMENTS

A Teacher Looks at Advent of Code 2020 - Days 21 and 24

Day 24 didn't take that much time so I had a chance to go back and finish day 21. As usual, all my code is up here. Day 21 Problem Link It took me a while to get my head around this example. You have a set of recipes. Each recipe has a list of ingredients and a list of allergens. Your job for part 1 was basically to determine which ingredients don't contain any allergens.
# COMMENTS

A Teacher Looks at Advent of Code 2020 - 19 through 23

A few days have past so it's time for an update. Two more days to go and while I haven't completed all the problems, I have accumulated 43 stars which is a personal best. Given the nature of the problems I'm missing, I might even go back and do them at some point. Of course, I may very well also just crash out on the final two days. As usual, all my code is up here.
# COMMENTS

A Teacher Looks at Advent of Code 2020 - Days 17 and 18

Day 17 Day 17 brought back Cellular Automata. It was a nice follow up to day 11. In my writeup I talked about data representation - how a Cellular Automoton like Conway's game of life is a nice 2D array project in a class like APCS-A but multi dimensional arrays are only one way to represent a cellular automaton. Day 17 really drove that home. The actual rules were pretty simple - if a cell is active and has 2 or 3 active neighbors it stays active.
# COMMENTS

A Teacher Looks at Advent of Code 2020 - day 16

Today's problem was a fun one to solve. Why was it fun? Stay tuned, The basic gist is that you have a plane ticket which is a set of numbers but you don't know which number maps to which category - row, seat, gate, etc. You also know the number ranges for each category. For example, row might be a number between 6 and 11 or 33 through 44 while a seat might be 13 through 40 or 45 through 50.
# COMMENTS

A teacher looks at Advent of Code day 14

Time for Day 14!!! I didn't write up day 12 but here's a Clojure video runthrough. I also didn't write up day 13 mostly because I hacked together my part 2 in Python and still want to rewrite it in decent clojure. In any event, all my solutions are up on GitHub. Day 14 had a few interesting things going on. At its core it's a small machine simulator where you have to deal with binary numbers.
# COMMENTS

A Teacher looks at Advent of Code 2020 - days 9 and 10

As we get closer to the end of the semester and time becomes scarcer I'm wondering how many more I'll finish. Barely had time to do days 9 and 10. Not much to say about day 9 Part one was basically a rehash of day 1 part 1 but with a sliding widow. Part 2? I just brute force tried all the subranges. I meant to go back to try to improve the solution but didn't have a chance.
# COMMENTS

A Teacher looks at Advent of Code 2020 - Days 7 and 8

Today we'll talk about days seven and eight. Let's start with 7. I teach all morning on Mondays. I woke up and worked out and then took a look at the problem in the few minutes before class. It was certainly harder than days one through six but I felt it was something I knew I could do based on past experience so I quickly started to throw something together.
# COMMENTS

A Teacher looks at Advent of Code 2020 - Day 06

Day 6 turned out to be pretty straightforward. Like day 4 you had to deal with two consecutive newlines when parsing the data but assuming you did day 4 that's no problem. The gist is that a group is formed by consecutive lines and groups are separated by a blank line. Each line in each group is a string of letters representing answers to questions. For instance, for this group: abc abd ab you have three people.
# COMMENTS

A teacher looks at Advent of Code 2020 - Day 5

Day five's problem is a nice one for an early CS class. It can be very much brute forced but it also touches on some nice concepts and can be solved pretty elegantly. I've embedded a walk through in Clojure at the end but a Python solution would be pretty similar. Read the problem over if you haven't. At it's core you are taking a boarding pass representing a coded airplane seat number and you're converting it to a known seat (row and column).
# COMMENTS