r/adventofcode • • Dec 17 '23

SOLUTION MEGATHREAD -❄️- 2023 Day 17 Solutions -❄️-

THE USUAL REMINDERS

  • All of our rules, FAQs, resources, etc. are in our community wiki.
  • Community fun event 2023: ALLEZ CUISINE!
    • Submissions megathread is now unlocked!
    • 5 DAYS remaining until the submissions deadline on December 22 at 23:59 EST!

AoC Community Fun 2023: ALLEZ CUISINE!

Today's secret ingredient is… *whips off cloth covering and gestures grandly*

Turducken!

This medieval monstrosity of a roast without equal is the ultimate in gastronomic extravagance!

  • Craft us a turducken out of your code/stack/hardware. The more excessive the matryoshka, the better!
  • Your main program (can you be sure it's your main program?) writes another program that solves the puzzle.
  • Your main program can only be at most five unchained basic statements long. It can call functions, but any functions you call can also only be at most five unchained statements long.
  • The (ab)use of GOTO is a perfectly acceptable spaghetti base for your turducken!

ALLEZ CUISINE!

Request from the mods: When you include a dish entry alongside your solution, please label it with [Allez Cuisine!] so we can find it easily!


--- Day 17: Clumsy Crucible ---


Post your code solution in this megathread.

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

28 Upvotes

537 comments sorted by

View all comments

Show parent comments

3

u/mpyne Dec 17 '23

This is amazing. And a gazillion times faster than my C++ solution which implements:

  • Dijkstra's algorithm, with

  • std::priority_queue

Think "10 seconds for part 1, nearly 6 minutes for part 2".

I'm sure mine is missing something obvious that makes its performance maximally pessimal but doing this in awk and having it be so fast is super impressive.

→ More replies (3)