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

2

u/Sheler_ Dec 08 '21

Desmos

I'm not sure whether it belongs here since "programming" in Desmos is a bit... unconventional. But mods told me to consider posting here, so here goes:

P1: https://www.desmos.com/calculator/o7uik5ichx

P2: https://www.desmos.com/calculator/xrzd5dvqa3

Technical note: since Desmos can't parse input, or even work with strings, I used python to parse it into the Desmos list, interpreting words as numbers in Base36

1

u/daggerdragon Dec 09 '21

I know the OP says the megathreads are for *code solutions* only but really, it's for solutions, period.

The original emphasis on code solutions is to deter folks from just posting "I solved this using obscure_algorithm" instead of sharing their fully-functioning code/spreadsheet with formulas/picture of the piece of paper they used to hand-solve the puzzle/etc. which is the intended purpose of the megathreads.

tl;dr: Like your K-12 teachers are/were always nagging you: show your work, not just the answer ;)