blob: 6ec0464f9bc6ad824b09233acf53849bf391f3a6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
--- Day 19: Tractor Beam ---
Unsure of the state of Santa's ship, you borrowed the tractor beam technology from Triton. Time to
test it out.
When you're safely away from anything else, you activate the tractor beam, but nothing happens.
It's hard to tell whether it's working if there's nothing to use it on. Fortunately, your ship's
drone system can be configured to deploy a drone to specific coordinates and then check whether it's
being pulled. There's even an Intcode program (your puzzle input) that gives you access to the drone
system.
The program uses two input instructions to request the [1m[97mX and Y position[0m to which the drone should be
deployed. Negative numbers are invalid and will confuse the drone; all numbers should be
[1m[97mzero or positive[0m.
Then, the program will output whether the drone is [1m[97mstationary[0m (0) or [1m[97mbeing pulled by something[0m (1).
For example, the coordinate X=0, Y=0 is directly in front of the tractor beam emitter, so the drone
control program will always report 1 at that location.
To better understand the tractor beam, it is important to [1m[97mget a good picture[0m of the beam itself. For
example, suppose you scan the 10x10 grid of points closest to the emitter:
X
0-> 9
0#.........
|.#........
v..##......
...###....
....###...
Y .....####.
......####
......####
.......###
9........##
In this example, the [1m[97mnumber of points affected by the tractor beam[0m in the 10x10 area closest to the
emitter is [1m[97m27[0m.
However, you'll need to scan a larger area to [1m[97munderstand the shape[0m of the beam. [1m[97mHow many points are
affected by the tractor beam in the 50x50 area closest to the emitter?[0m (For each of X and Y, this
will be 0 through 49.)
|