Skip to main content

C'est la Z

Tag: Advent of Code

Transparent Origami - Advent 2021 Day 13

No post so far on day 12. I finished part 1 but my code was pretty messy which turned part 2 into a mess. I still have to go back to get that second star so just like day 10, my day 12 write up is on hold. That said, I really enjoyed [[https://adventofcode.com/2021/day/13 ][today's]] challenge. Paper foldind. You're given transparent paper with a bunch of marks on it.
# COMMENTS

Dumbo Octopus and the Game of Life - AOC 2011 Day 11

I wasn't particularly motivated to start day 11 but took a look over coffee. A grid of points where on each turn or step the points are modified by some rule. Hey, this sounds familiar - cellular automata like Conway's Game of Life. You set up your grid and then on each turn just follow the rules. In a traditional Cellular Automaton like Conway's Game of Life, on each turn each cell looks at its six neighbors and makes a decision as to its next state based on the neighbors and a rule.
# COMMENTS

Bracket Bonanza (AOC 2021 day 10)

I know, where's day 9? Thursdays (and Mondays) are already tight for me - I teach all morning and it's been a rough week. I just had very little energy and focus all day yesterday. I snuck some time in to finish part 1 but couldn't focus on part 2. Today, however, my body gave me an extra half hour of sleep (til 4:30am) so I had extra time and energy.
# COMMENTS

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.
# 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.
# COMMENTS