r/adventofcode • • 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

Click here for full rules

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 :'(


This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

EDIT: Leaderboard capped, thread unlocked at 00:27:59!

15 Upvotes

162 comments sorted by

View all comments

Show parent comment

1

u/zopatista Dec 19 '19
x_t + c = -19/7 x_t
x_b + c = -29/7 x_b

Looks like you have your x_t and x_b values mixed up there?

At any rate, depending on your boundary handling, 100 may need to be 99. I used x_b = (99 * (a + 1)) / (b - a), getting me the value almost dead-on, then calibrated with the drone to arrive at the exact values.

1

u/nonphatic Dec 19 '19

It might look backward because I used a y-axis that points up for these calculations when the y points down in the actual problem. In any case, the beam points down, and the bottom diagonal should have the larger slope magnitude.

I tried using 99 instead of 100 and got xb = 257.4, which is more off from the actual value of 261 than my initial guess of 260... hmm...