r/adventofcode • u/daggerdragon • Dec 05 '22
SOLUTION MEGATHREAD -π- 2022 Day 5 Solutions -π-
All of our rules, FAQs, resources, etc. are in our community wiki.
A request from Eric: Please include your contact info in the User-Agent header of automated requests!
Signal boost: Reminder 1: unofficial AoC Survey 2022 (closes Dec 22nd)
AoC Community Fun 2022: πΏπ MisTILtoe Elf-ucation π§βπ«
23:59 hours remaining until the submissions megathread unlocks on December 06 at 00:00 EST!
Full details and rules are in the submissions megathread:
--- Day 5: Supply Stacks ---
Post your code solution in this megathread.
Read the full posting rules in our community wiki before you post!
Include what language(s) your solution uses
Format your code appropriately! How do I format code?
Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
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:07:58, megathread unlocked!
88
Upvotes
2
u/Colin-McMillen Dec 08 '22
AppleSoft BASIC on Apple //c
Part 1: Most of the code is parsing the data. Had a bit a fun using "functions" (aka GOSUB/RETURN) instead of GOTOs, making the thing a little bit less hard to read.
Part 2: Copy-pasted, and simplified the stack moving. There's a clearing bug on long stacks, but it happens far enough in the run that I didn't take the time to debug it and re-run.
Video of part 2. Most of the code's upload is sped up 4x, and the stack moving 16x, to avoid being REALLY boring.