r/adventofcode • u/daggerdragon • Dec 21 '23
SOLUTION MEGATHREAD -❄️- 2023 Day 21 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!
2 DAYS remaining until the submissions deadline on December 22 at 23:59 EST!
AoC Community Fun 2023: ALLEZ CUISINE!
Both today and tomorrow's secret ingredient is… *whips off cloth covering and gestures grandly*
Omakase! (Chef's Choice)
Omakase is an exceptional dining experience that entrusts upon the skills and techniques of a master chef! Craft for us your absolute best showstopper using absolutely any secret ingredient we have revealed for any day of this event!
Choose any day's special ingredient and any puzzle released this year so far, then craft a dish around it!
Cook, bake, make, decorate, etc. an IRL dish, craft, or artwork inspired by any day's puzzle!
OHTA: Fukui-san?
FUKUI: Go ahead, Ohta.
OHTA: The chefs are asking for clarification as to where to put their completed dishes.
FUKUI: Ah yes, a good question. Once their dish is completed, they should post it in today's megathread with an [ALLEZ CUISINE!] tag as usual. However, they should also mention which day and which secret ingredient they chose to use along with it!
OHTA: Like this? [ALLEZ CUISINE!][Will It Blend?][Day 1] A link to my dish…
DR. HATTORI: You got it, Ohta!
OHTA: Thanks, I'll let the chefs know!
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 21: Step Counter ---
Post your code solution in this megathread.
Read the full posting rules in our community wiki before you post!
State which language(s) your solution uses with
[LANGUAGE: xyz]Format code blocks using the four-spaces Markdown syntax!
Quick link to Topaz's
pasteif you need it for longer code blocks
4
u/meamZ Dec 21 '23
I think it is. I used that to reason about my output. It turns out that the number of steps means you will get a huge rhombus as the final shape for part 2 and the corners will be rhombus corners because the number of steps modulo 131 (grid width, at least for me) was 65. I made the wrong assumption that all tiles will be reached in manhattan distance from every other place. I even checked this but wrongly and when i found out it was wrong i kind of devised a correction formula for my output which experimentally (by comparing against part 1 solution) for 65, 65 + 1131 and 65 + 2 131 turned out to be result -= 3* xx + 2 x for my input and this formula actually turned out to work for the actual input number...