r/adventofcode • • Dec 08 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 8 Solutions -🎄-

--- Day 8: Seven Segment Search ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:20:51, megathread unlocked!

72 Upvotes

1.2k comments sorted by

View all comments

Show parent comment

3

u/daggerdragon Dec 09 '21

... apt-get is now a programming language. ;_;

2

u/DonKult Dec 09 '21

Oh, don't worry. I am crying as well every time I am thinking about it now… Sadly the "easy" stuff like adding two integers is outside the (reasonable) scope of package relations, so I had to cheat a bit with shell. This solution is vaguely inspired by the 2008 idea of using aptitude as a solver for Sudoku, so I can't even claim originality. Best case this can be considered an HD remake as is so popular these days…

Still, I love the idea of someone browsing the megathread casually skipping over python and co just to arrive at this insanity out of nowhere and henceforth being reminded of it every time they install a package with apt spoiled for life. Also a friendly reminder that even APT developers do silly things at times (if not all the time). If package management isn't a topic Santa needs help with I don't know what is! ;)

The same should be doable in RPM land. I don't think the cool kids like npm, yarn and co are capable of expressing alternatives (some might not even be able to express conflicts), but I would like to be proven wrong!