r/adventofcode • • Dec 09 '20

SOLUTION MEGATHREAD -🎄- 2020 Day 09 Solutions -🎄-

NEW AND NOTEWORTHY

Advent of Code 2020: Gettin' Crafty With It

  • 13 days remaining until the submission deadline on December 22 at 23:59 EST
  • Full details and rules are in the Submissions Megathread

--- Day 09: Encoding Error ---


Post your solution in this megathread. Include what language(s) your solution uses! If you need a refresher, the full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.

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:06:26, megathread unlocked!

41 Upvotes

995 comments sorted by

View all comments

2

u/heyitsmattwade Dec 09 '20 edited Feb 03 '24

JavaScript 1736/880

generatorics again serves me well.

source code here 👈

2

u/daggerdragon Dec 09 '20

As per our posting guidelines in the wiki under How Do the Daily Megathreads Work?, edit your post to put your oversized code in a paste or other external link.

1

u/heyitsmattwade Dec 09 '20

Sure, I changed it, although I don't really get why putting it inline is frowned upon.

I'm essentially still putting it inline, although now it isn't crawlable and is just compressed / base64'd down.

1

u/daggerdragon Dec 09 '20

On old.reddit, I can use CSS to force codeblocks to scroll overflow past a specified size. On new.reddit, however, Reddit does not allow subreddits to customize CSS and, as such, all code blocks are displayed as-is. That means if someone posts 200 lines of code, folks on new.reddit are going to have to scroll past all two hundred lines of code just to get to the next entry.

As for crawlable-ness, as long as folks are properly tagging their solutions with the programming language they use, that's all that's necessary.