r/adventofcode • u/daggerdragon • Dec 19 '19
SOLUTION MEGATHREAD -🎄- 2019 Day 19 Solutions -🎄-
--- Day 19: Tractor Beam ---
Post your full code solution using /u/topaz2078's paste or other external repo.
- Please do NOT post your full code (unless it is very short)
- If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.
- NEW RULE: Include the language(s) you're using.
(Full posting rules are HERE if you need a refresher).
Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
Advent of Code's Poems for Programmers
Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.
Day 18's winner #1: nobody! :(
Nobody submitted any poems at all for Day 18 :( Not one person. :'( y u all make baby space cleaning hull-painting scaffold-building robot cry :'(
View all comments
Show parent comment
2
u/nibarius Dec 19 '19
I came up with the exact algorithm for part 2 but I thought I was looking for a 10x10 square so it naturally didn't work. I started printing the whole beam up to 500 in each direction to try to figure out what was wrong.
When I finally realized I was supposed to look for a 100x100 square I forgot about my initial solution. I realized scanning a whole area that fits a 100x100 square takes to much time so I tried to see some kind of pattern in the beam to calculate where the 100x100 square would be.
Failing that I came here for hints and found your comment and realized I was doing everything right in the beginning, except reading the instructions.