annotate day10.txt @ 19:1e16a25a9553

Strip down the text to just the puzzle, not the fluff
author IBBoard <dev@ibboard.co.uk>
date Mon, 11 Dec 2023 20:38:55 +0000
parents 92144824cbb7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 --- Day 10: Pipe Maze ---
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
19
1e16a25a9553 Strip down the text to just the puzzle, not the fluff
IBBoard <dev@ibboard.co.uk>
parents: 17
diff changeset
3 You are in an area filled with pipes/paths. Your puzzle input is a map of the path of those pipes.
16
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 The pipes are arranged in a two-dimensional grid of tiles:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 | is a vertical pipe connecting north and south.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 - is a horizontal pipe connecting east and west.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 L is a 90-degree bend connecting north and east.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 J is a 90-degree bend connecting north and west.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 7 is a 90-degree bend connecting south and west.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 F is a 90-degree bend connecting south and east.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 . is ground; there is no pipe in this tile.
19
1e16a25a9553 Strip down the text to just the puzzle, not the fluff
IBBoard <dev@ibboard.co.uk>
parents: 17
diff changeset
14 S is the starting position; there is a pipe on this tile, but your sketch doesn't show what shape the pipe has.
16
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15
19
1e16a25a9553 Strip down the text to just the puzzle, not the fluff
IBBoard <dev@ibboard.co.uk>
parents: 17
diff changeset
16 There is at least one continuous loop. You want to get to the point that is furthest around the path from the start point.
16
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 For example, here is a square loop of pipe:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 .F-7.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 .|.|.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 .L-J.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25
19
1e16a25a9553 Strip down the text to just the puzzle, not the fluff
IBBoard <dev@ibboard.co.uk>
parents: 17
diff changeset
26 If the start is in the northwest corner, the sketch would instead look like this:
16
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 .S-7.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 .|.|.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 .L-J.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 In the above diagram, the S tile is still a 90-degree F bend: you can tell because of how the adjacent pipes connect to it.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 Unfortunately, there are also many pipes that aren't connected to the loop! This sketch shows the same loop as above:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 -L|F7
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 7S-7|
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 L|7||
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 -L-J|
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 L|-JF
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 In the above diagram, you can still figure out which pipes form the main loop: they're the ones connected to S, pipes those pipes connect to, pipes those pipes connect to, and so on. Every pipe in the main loop connects to its two neighbors (including S, which will have exactly two pipes connecting to it, and which is assumed to connect back to those two pipes).
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 Here is a sketch that contains a slightly more complex main loop:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 ..F7.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 .FJ|.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 SJ.L7
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 |F--J
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 LJ...
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54 Here's the same example sketch with the extra, non-main-loop pipe tiles also shown:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 7-F7-
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 .FJ|7
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 SJLL7
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 |F--J
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 LJ.LJ
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61
19
1e16a25a9553 Strip down the text to just the puzzle, not the fluff
IBBoard <dev@ibboard.co.uk>
parents: 17
diff changeset
62 When measuring the distance in the first example with the square loop:
16
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 .S-7.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 .|.|.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67 .L-J.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70 You can count the distance each tile in the loop is from the starting point like this:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 .012.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74 .1.3.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
75 .234.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76 .....
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78 In this example, the farthest point from the start is 4 steps away.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
79
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 Here's the more complex loop again:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
81
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
82 ..F7.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83 .FJ|.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
84 SJ.L7
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
85 |F--J
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
86 LJ...
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
87
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
88 Here are the distances for each tile on that loop:
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
89
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
90 ..45.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
91 .236.
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
92 01.78
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
93 14567
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
94 23...
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
95
9b1d04091335 Path finding through the pipes for day 10
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
96 Find the single giant loop starting at S. How many steps along the loop does it take to get from the starting position to the point farthest from the starting position?
17
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
97
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
98 --- Part Two ---
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
99
19
1e16a25a9553 Strip down the text to just the puzzle, not the fluff
IBBoard <dev@ibboard.co.uk>
parents: 17
diff changeset
100 Maybe there is something enclosed within the loops of the path? You need to calculate how many tiles are contained within the loop. For example:
17
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
101
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
102 ...........
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
103 .S-------7.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
104 .|F-----7|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
105 .||.....||.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
106 .||.....||.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
107 .|L-7.F-J|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
108 .|..|.|..|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
109 .L--J.L--J.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
110 ...........
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
111
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
112 The above loop encloses merely four tiles - the two pairs of . in the southwest and southeast (marked I below). The middle . tiles (marked O below) are not in the loop. Here is the same loop again with those regions marked:
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
113
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
114 ...........
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
115 .S-------7.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
116 .|F-----7|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
117 .||OOOOO||.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
118 .||OOOOO||.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
119 .|L-7OF-J|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
120 .|II|O|II|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
121 .L--JOL--J.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
122 .....O.....
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
123
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
124 In fact, there doesn't even need to be a full tile path to the outside for tiles to count as outside the loop - squeezing between pipes is also allowed! Here, I is still within the loop and O is still outside the loop:
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
125
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
126 ..........
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
127 .S------7.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
128 .|F----7|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
129 .||OOOO||.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
130 .||OOOO||.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
131 .|L-7F-J|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
132 .|II||II|.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
133 .L--JL--J.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
134 ..........
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
135
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
136 In both of the above examples, 4 tiles are enclosed by the loop.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
137
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
138 Here's a larger example:
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
139
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
140 .F----7F7F7F7F-7....
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
141 .|F--7||||||||FJ....
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
142 .||.FJ||||||||L7....
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
143 FJL7L7LJLJ||LJ.L-7..
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
144 L--J.L7...LJS7F-7L7.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
145 ....F-J..F7FJ|L7L7L7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
146 ....L7.F7||L7|.L7L7|
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
147 .....|FJLJ|FJ|F7|.LJ
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
148 ....FJL-7.||.||||...
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
149 ....L---J.LJ.LJLJ...
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
150
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
151 The above sketch has many random bits of ground, some of which are in the loop (I) and some of which are outside it (O):
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
152
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
153 OF----7F7F7F7F-7OOOO
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
154 O|F--7||||||||FJOOOO
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
155 O||OFJ||||||||L7OOOO
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
156 FJL7L7LJLJ||LJIL-7OO
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
157 L--JOL7IIILJS7F-7L7O
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
158 OOOOF-JIIF7FJ|L7L7L7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
159 OOOOL7IF7||L7|IL7L7|
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
160 OOOOO|FJLJ|FJ|F7|OLJ
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
161 OOOOFJL-7O||O||||OOO
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
162 OOOOL---JOLJOLJLJOOO
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
163
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
164 In this larger example, 8 tiles are enclosed by the loop.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
165
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
166 Any tile that isn't part of the main loop can count as being enclosed by the loop. Here's another example with many bits of junk pipe lying around that aren't connected to the main loop at all:
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
167
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
168 FF7FSF7F7F7F7F7F---7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
169 L|LJ||||||||||||F--J
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
170 FL-7LJLJ||||||LJL-77
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
171 F--JF--7||LJLJ7F7FJ-
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
172 L---JF-JLJ.||-FJLJJ7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
173 |F|F-JF---7F7-L7L|7|
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
174 |FFJF7L7F-JF7|JL---7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
175 7-L-JL7||F7|L7F-7F7|
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
176 L.L7LFJ|||||FJL7||LJ
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
177 L7JLJL-JLJLJL--JLJ.L
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
178
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
179 Here are just the tiles that are enclosed by the loop marked with I:
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
180
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
181 FF7FSF7F7F7F7F7F---7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
182 L|LJ||||||||||||F--J
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
183 FL-7LJLJ||||||LJL-77
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
184 F--JF--7||LJLJIF7FJ-
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
185 L---JF-JLJIIIIFJLJJ7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
186 |F|F-JF---7IIIL7L|7|
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
187 |FFJF7L7F-JF7IIL---7
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
188 7-L-JL7||F7|L7F-7F7|
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
189 L.L7LFJ|||||FJL7||LJ
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
190 L7JLJL-JLJLJL--JLJ.L
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
191
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
192 In this last example, 10 tiles are enclosed by the loop.
92144824cbb7 Add "inside the loop" counting for day 10 part 2
IBBoard <dev@ibboard.co.uk>
parents: 16
diff changeset
193
19
1e16a25a9553 Strip down the text to just the puzzle, not the fluff
IBBoard <dev@ibboard.co.uk>
parents: 17
diff changeset
194 How many tiles are enclosed by the loop?