πŸ’Ύ Archived View for gerikson.com β€Ί gemlog β€Ί misc β€Ί AoC-2021.gmi captured on 2021-12-03 at 14:04:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

➑️ Next capture (2021-12-04)

-=-=-=-=-=-=-

The occasional geminer - an artisanal, handcrafted gemlog

↑ latest entries

Advent of Code 2021

This is a mirror of the main blog post

code listing

Advent of Code site

Day 01 - Sonar Sweep

And we're off!

I wonder if I got a bit too clever by half in this solution, as I've been looking over older solutions and can't even remember solving them. But that's how it goes I guess.

Puzzle rating: 3/5

Score: 2

Day 02 - Dive!

A "standard" Perlish solution (well, *my* kind of Perl, anyway): a dispatch table for the else/if "switch" construct, and a compact hash containing the state of the two solutions.

Puzzle rating: 3/5

Score: 2

Day 03 - Binary Diagnostic

I was honestly surprised that the canonical solution to this wasn't some esoteric bit-twiddling trick that reduces it to a one-liner.

In part 2, the naive solution is to loop through each "column" to determine which values to count so as to determine whether they are most frequent or not. I used an index for each "set" to keep track of the values already assigned to that set.

Puzzle rating: 3/5

Score: 2

────────────────────────────────────────────

Updated on Friday, 2021-12-03

✽ Wednesday, 2021-12-01

β†’ more posts in the β€Ήmiscβ€Ί category

About this category: β€œWhat is says in the URL path”

Copyright Β© 2018 - 2021 Gustaf Erikson

Main page for this gemsite