Skip to main content

C'est la Z

Tag: Advent of Code

Seven Segment Silliness - Advent 2021 Day08

Day 8 took a lot longer than the other days. Not all that much code and not too complex, at least after getting through a scary sounding lead up but going from problem statement to solution took both time and thought. As I started to read the problem, I wasn't sure I'd finish it let alone have time to write it up. Take a minute to read over the problem.
# COMMENTS

How you look at a problem can make it easier - AOC 2021 Day 7

Today's problem was similar to yesterday's in that it's ease or difficulty really depended on how you looked at the question. For yesterday, the problem was hard if you approached it by modeling each and every lanternfish but it was much easier if you modeled the 8 days of the reproduction cycle. Sure, there was still work to be done but looking at the problem the right way made things much easier.
# COMMENTS

Lanternfish and lots of data (AOC 2021 Day 6)

Today we had to model the growth of the lanternfish population (problem here). Lanternfish spawn new lanternfish every seven days. The trick is that the original starting population consists of fish at different points in the cycle. For instance, if your input data was 3,2,4 then each fish would spawn a new fish in three, two, and four days respectively. The new fish would set their timers to 8 and start counting down to their spawn date on the next day and the original fish would reset it's timer to 6.
# COMMENTS

One man's complex is another man's simple (AOC 2021 Day 5)

Yesterday I wrote about the virtues of a simple straightforward solution as opposed to a super "clever" one. Today reminded me that what seems simple to one person might be clever to another. Having successfully survived bingo with a giant squid, Today's challenge had us navigating our sub so as to avoid dangerous parts of the ocean. We were given a bunch of lines represented by endpoints as input. If we graphed all the lines, some of them would overlap.
# COMMENTS

Working code is better than clever code (AOC 2021 day 4)

I always tell my students that the cleverest program is worthless if it doesn't actually work. There are always some kids in class that all too often try to write the fanciest solutions. They're the ones that write int l(char *s){return !*s?0:(l(++s)+1);} instead of something like: int string_length(char *s){ int i = 0; while (s[i] != 0){ i=i+1; } return i; } to calculate the length of a string.
# COMMENTS

Work through the example!!!!!

It's that time of year again. Yep, you got it. Time for Advent of Code. I'm not feeling nearly as motivated as in past years but so far so good. Finished the first three days. Today I got a good reminder - work through your examples. You can find today's problem here. For part 1 you got a list of binary numbers and had to figure out how many ones and zeros there were in any given digit.
# COMMENTS

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. This was also the first year I wrote all my solutions in Clojure and I also made a bunch of blog posts and videos (linked on the bottom of this post).
# 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