Solve day 14 part 1

This commit is contained in:
Gabriel Augendre 2022-12-16 22:58:07 +01:00
parent 94521523db
commit d5c4b069ac
3 changed files with 242 additions and 0 deletions

84
2022/day14_sand.py Normal file
View file

@ -0,0 +1,84 @@
from __future__ import annotations
def main(filename: str, expected_part_1: int = None, expected_part_2: int = None):
print(f"\n+ Running on {filename}")
with open(filename) as f:
data = f.read().strip().split("\n")
data, deepest_wall = parse_data(data)
solution_part_1 = solve_part_1(data, deepest_wall)
print(f"1. Found {solution_part_1}")
if expected_part_1:
assert expected_part_1 == solution_part_1
solution_part_2 = solve_part_2(data)
print(f"2. Found {solution_part_2}")
if expected_part_2:
assert expected_part_2 == solution_part_2
Point = tuple[int, int]
Walls = set(Point)
def generate_wall(start: Point, end: Point) -> Walls:
walls = {start, end}
if start == end:
return {start}
elif start[0] == end[0]:
ys = (start[1], end[1])
for y in range(min(ys) + 1, max(ys)):
walls.add((start[0], y))
elif start[1] == end[1]:
xs = (start[0], end[0])
for x in range(min(xs) + 1, max(xs)):
walls.add((x, start[1]))
return walls
def parse_data(data: list[str]) -> Walls:
walls = set()
deepest_wall = 0
for line in data:
angles = []
for angle in line.split(" -> "):
angles.append(tuple(map(int, angle.split(","))))
for start, end in zip(angles[:-1], angles[1:]):
if start[1] > deepest_wall:
deepest_wall = start[1]
if end[1] > deepest_wall:
deepest_wall = end[1]
walls.update(generate_wall(start, end))
return walls, deepest_wall
def solve_part_1(walls: Walls, deepest_wall: int) -> int:
sand_source = (500, 0)
sand: Walls = set()
while True:
sand_x, sand_y = sand_source
while sand_y < deepest_wall:
if (sand_x, sand_y + 1) not in walls | sand:
sand_y += 1
elif (sand_x - 1, sand_y + 1) not in walls | sand:
sand_x -= 1
sand_y += 1
elif (sand_x + 1, sand_y + 1) not in walls | sand:
sand_x += 1
sand_y += 1
else:
sand.add((sand_x, sand_y))
break
if sand_y >= deepest_wall:
return len(sand)
def solve_part_2(walls: Walls) -> int:
return 0
if __name__ == "__main__":
main("inputs/day14-test1", expected_part_1=24)
main("inputs/day14", expected_part_1=843)

156
2022/inputs/day14 Normal file
View file

@ -0,0 +1,156 @@
476,71 -> 481,71
484,52 -> 488,52
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
481,61 -> 485,61
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
454,163 -> 459,163
444,147 -> 449,147
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
459,73 -> 464,73
447,150 -> 447,154 -> 440,154 -> 440,160 -> 455,160 -> 455,154 -> 453,154 -> 453,150
447,150 -> 447,154 -> 440,154 -> 440,160 -> 455,160 -> 455,154 -> 453,154 -> 453,150
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
447,150 -> 447,154 -> 440,154 -> 440,160 -> 455,160 -> 455,154 -> 453,154 -> 453,150
472,64 -> 476,64
447,144 -> 452,144
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
487,61 -> 491,61
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
484,64 -> 488,64
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
484,76 -> 484,80 -> 482,80 -> 482,83 -> 493,83 -> 493,80 -> 487,80 -> 487,76
455,169 -> 460,169
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
447,150 -> 447,154 -> 440,154 -> 440,160 -> 455,160 -> 455,154 -> 453,154 -> 453,150
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
447,150 -> 447,154 -> 440,154 -> 440,160 -> 455,160 -> 455,154 -> 453,154 -> 453,150
480,73 -> 485,73
462,71 -> 467,71
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
487,55 -> 491,55
478,58 -> 482,58
487,48 -> 487,49 -> 494,49 -> 494,48
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
477,87 -> 477,88 -> 486,88
477,87 -> 477,88 -> 486,88
493,61 -> 497,61
458,117 -> 458,121 -> 450,121 -> 450,125 -> 471,125 -> 471,121 -> 463,121 -> 463,117
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
454,144 -> 459,144
447,150 -> 447,154 -> 440,154 -> 440,160 -> 455,160 -> 455,154 -> 453,154 -> 453,150
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
458,117 -> 458,121 -> 450,121 -> 450,125 -> 471,125 -> 471,121 -> 463,121 -> 463,117
458,117 -> 458,121 -> 450,121 -> 450,125 -> 471,125 -> 471,121 -> 463,121 -> 463,117
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
450,141 -> 455,141
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
484,76 -> 484,80 -> 482,80 -> 482,83 -> 493,83 -> 493,80 -> 487,80 -> 487,76
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
484,76 -> 484,80 -> 482,80 -> 482,83 -> 493,83 -> 493,80 -> 487,80 -> 487,76
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
446,128 -> 446,131 -> 442,131 -> 442,138 -> 452,138 -> 452,131 -> 450,131 -> 450,128
493,27 -> 493,28 -> 512,28 -> 512,27
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
493,27 -> 493,28 -> 512,28 -> 512,27
481,55 -> 485,55
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
447,150 -> 447,154 -> 440,154 -> 440,160 -> 455,160 -> 455,154 -> 453,154 -> 453,150
484,76 -> 484,80 -> 482,80 -> 482,83 -> 493,83 -> 493,80 -> 487,80 -> 487,76
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
462,169 -> 467,169
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
484,76 -> 484,80 -> 482,80 -> 482,83 -> 493,83 -> 493,80 -> 487,80 -> 487,76
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
446,128 -> 446,131 -> 442,131 -> 442,138 -> 452,138 -> 452,131 -> 450,131 -> 450,128
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
458,117 -> 458,121 -> 450,121 -> 450,125 -> 471,125 -> 471,121 -> 463,121 -> 463,117
446,128 -> 446,131 -> 442,131 -> 442,138 -> 452,138 -> 452,131 -> 450,131 -> 450,128
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
465,69 -> 470,69
448,169 -> 453,169
478,64 -> 482,64
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
484,76 -> 484,80 -> 482,80 -> 482,83 -> 493,83 -> 493,80 -> 487,80 -> 487,76
490,58 -> 494,58
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
484,58 -> 488,58
491,43 -> 491,44 -> 500,44 -> 500,43
472,69 -> 477,69
446,128 -> 446,131 -> 442,131 -> 442,138 -> 452,138 -> 452,131 -> 450,131 -> 450,128
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
491,43 -> 491,44 -> 500,44 -> 500,43
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
458,117 -> 458,121 -> 450,121 -> 450,125 -> 471,125 -> 471,121 -> 463,121 -> 463,117
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
473,73 -> 478,73
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
468,67 -> 473,67
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
458,117 -> 458,121 -> 450,121 -> 450,125 -> 471,125 -> 471,121 -> 463,121 -> 463,117
490,64 -> 494,64
466,73 -> 471,73
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
451,147 -> 456,147
469,71 -> 474,71
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
491,43 -> 491,44 -> 500,44 -> 500,43
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
458,117 -> 458,121 -> 450,121 -> 450,125 -> 471,125 -> 471,121 -> 463,121 -> 463,117
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
458,166 -> 463,166
458,147 -> 463,147
493,27 -> 493,28 -> 512,28 -> 512,27
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
446,128 -> 446,131 -> 442,131 -> 442,138 -> 452,138 -> 452,131 -> 450,131 -> 450,128
487,48 -> 487,49 -> 494,49 -> 494,48
446,128 -> 446,131 -> 442,131 -> 442,138 -> 452,138 -> 452,131 -> 450,131 -> 450,128
461,114 -> 461,113 -> 461,114 -> 463,114 -> 463,105 -> 463,114 -> 465,114 -> 465,112 -> 465,114 -> 467,114 -> 467,105 -> 467,114 -> 469,114 -> 469,112 -> 469,114 -> 471,114 -> 471,109 -> 471,114 -> 473,114 -> 473,104 -> 473,114
487,48 -> 487,49 -> 494,49 -> 494,48
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
496,64 -> 500,64
484,76 -> 484,80 -> 482,80 -> 482,83 -> 493,83 -> 493,80 -> 487,80 -> 487,76
451,166 -> 456,166
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41
446,128 -> 446,131 -> 442,131 -> 442,138 -> 452,138 -> 452,131 -> 450,131 -> 450,128
496,23 -> 496,16 -> 496,23 -> 498,23 -> 498,22 -> 498,23 -> 500,23 -> 500,17 -> 500,23 -> 502,23 -> 502,21 -> 502,23
475,61 -> 479,61
469,101 -> 469,95 -> 469,101 -> 471,101 -> 471,96 -> 471,101 -> 473,101 -> 473,96 -> 473,101 -> 475,101 -> 475,100 -> 475,101 -> 477,101 -> 477,91 -> 477,101 -> 479,101 -> 479,91 -> 479,101 -> 481,101 -> 481,98 -> 481,101
503,41 -> 503,36 -> 503,41 -> 505,41 -> 505,34 -> 505,41 -> 507,41 -> 507,40 -> 507,41 -> 509,41 -> 509,33 -> 509,41 -> 511,41 -> 511,32 -> 511,41 -> 513,41 -> 513,40 -> 513,41 -> 515,41 -> 515,31 -> 515,41 -> 517,41 -> 517,31 -> 517,41 -> 519,41 -> 519,31 -> 519,41 -> 521,41 -> 521,33 -> 521,41

2
2022/inputs/day14-test1 Normal file
View file

@ -0,0 +1,2 @@
498,4 -> 498,6 -> 496,6
503,4 -> 502,4 -> 502,9 -> 494,9