r/adventofcode • • Dec 14 '23

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

OUR USUAL ADMONITIONS

  • You can find all of our customs, FAQs, axioms, and so forth in our community wiki.
  • Community fun shindig 2023: GO COOK!

    • Submissions ultrapost forthwith allows public contributions!
    • 7 DAYS until submissions cutoff on this Last Month 22 at 23:59 Atlantic Coast Clock Sync!

AoC Community Fun 2023: GO COOK!

Today's unknown factor is… *whips off cloth shroud and motions grandly*

Avoid Glyphs

  • Pick a glyph and do not put it in your program.

    • Avoiding fifthglyphs is traditional.
  • Thou shalt not apply functions nor annotations that solicit this taboo glyph.
  • Thou shalt ambitiously accomplish avoiding AutoMod’s antagonism about ultrapost's mandatory programming variant tag >_>

GO COOK!

Stipulation from your mods: As you affix a dish submission along with your solution, do tag it with [Go Cook!] so folks can find it without difficulty!


--- Day 14: Parabolic R*fl*ctor Mirror Dish ---


Post your script solution in this ultrapost.

This forum will allow posts upon a significant amount of folk on today's global ranking with gold stars for today's activity.

MODIFICATION: Global ranking gold list is full as of 00:17:15, ultrapost is allowing submissions!

24 Upvotes

632 comments sorted by

View all comments

1

u/flwyd Dec 14 '23 edited Dec 16 '23

[Language: Julia] (on GitHub)

Well I just spent well over an hour trying to figure out why my part 2 scores never got below 100, let alone to 64, despite verifying I get the same three outputs from rock cycling. Turns out I was reusing my "the score is the sum of loads if you shifted everything to the north" and not "shift everything to the north in part 1, then call a score function."

Left my part 1 solution (northweight which takes a row and computes the sum of weights in that row, since I was verifying intermediate outputs following the description). Once I realized I needed a separate score function on part 2, my cycle finding code was already correct, so I've got that going for me, which is nice.

2

u/aldonius Dec 14 '23

Turns out I was reusing my "the score is the sum of loads if you shifted everything to the north" and not "shift everything to the north in part 1, then call a score function."

THANK YOU this is the exact issue I'm stuck on right now.

1

u/daggerdragon Dec 14 '23 edited Dec 16 '23

Your code block is too long for the megathreads. Please edit your comment to replace your oversized code with just the GitHub external link to your code. edit: 👍

2

u/flwyd Dec 15 '23

Okay, I've densified it a bit.

1

u/daggerdragon Dec 15 '23

Still too long, bro, sorry. It's 46 LoC and I have to scroll the box three times.

I recommend line-linking directly to the functions in your GitHub like:

The key functions are cyclerocks(grid) and...

where the URL to that function is:

https://github.com/flwyd/adventofcode/blob/11b5d30a93a179f8f465bcc9f76f024e45a65e9b/2023/day14/Day14.jl#L52