-
Advent of Code Day 8: Playground is complete!
Went for python again today. That puts python at the top of the repo language breakdown, so I'll try to avoid it for the rest of Advent (I'll try to go for yet-unused languages or ones near the bottom of the list). But boy, do those collections and itertools simplify these kinds of problems. Shoutout to my homies
defaultdict(set)anditertools.combinations❗ Honorable mentions go tomapandsorted.Today was the easiest part 2 relative to part 1 (or maybe, tied with day 4, which I think is still my favorite so far).
-
Advent of Code Day 7: Laboratories is complete!
Finally did python today. Wasn't too bad.
-
Advent of Code Day 6: Trash Compactor is complete!
Clojure gets added to the list. I laughed out loud at the twist for part 2. It's not very fast, but I had fun doing it. It's also not very long (in bytes of source), given its brute force complexity and how long it took to write.
-
Advent of Code Day 5: Cafeteria is complete!
Did AutoLISP on this one, and it sucked. I forgot to reason about how this works again, specifically that the real problem inputs contain big fat 64 bit ints, which aren't available in AutoLISP. So I had to perform the manual gradeschool arithmetic method on digit strings.
Then it turns out the sample input doesn't cover the edge cases in the real input. So I had to do a little squint-eyed search to find someone else's test case that I could run against.
I don't feel too bad tho, as the running joke on the subreddit for today is "system ran out of memory trying to store every number".
-
Advent of Code Day 4: Printing Department is complete!
Got C out of the way today. Nothing insightful to report; just brute forced both parts with nested for loops.
-
Advent of Code Day 3: Lobby is complete!
I haven't done any rust in a while. You could say I'm a bit…rusty.
Part 1 was totally straightforward, and I kick myself for forgetting there'd be a part 2 and not immediately realizing it was going to ask for more digits. I could have just done the general solution right away.
This one even has a test suite!
-
Advent of Code Day 2: Gift Shop is complete!
Went for javascript this time (on node for CLI goodness). I figure I better get it out of the way now and save more fun languages for later more difficult problems. (Idea: one of the days should be some kind of polyglot docker compose microservice hell.)
Not much to comment on here: this one seems even more straightforward than day 1. I imagine it can be boiled down to a crazy one-liner. At least the string parsing was a little shorter today.
-
Advent of Code Day 1: Secret Entrance complete! See my solution over at sghetti.dev.
Since it's still early and simple, I went for r5rs scheme. There's something so satisfying about programming in a language with barely a standard library at all. Later, I'm sure the lack of basic facilities like reading a file line-by-line will become too annoying to deal with. But for the first problem, it was fine.
I'm toying with the idea of doing each day in a different language, but we'll see. I'd rather complete the whole thing in python than burn out trying to do day 12 in AutoLISP because I wasted all my good languages on the early days.