Skip to content

Commit 7a750a0

Browse files
committed
start day14
1 parent d907667 commit 7a750a0

File tree

2 files changed

+166
-0
lines changed

2 files changed

+166
-0
lines changed

day14/input

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
2+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
3+
497,76 -> 497,80 -> 494,80 -> 494,86 -> 508,86 -> 508,80 -> 503,80 -> 503,76
4+
498,13 -> 502,13
5+
525,120 -> 525,122 -> 522,122 -> 522,130 -> 535,130 -> 535,122 -> 531,122 -> 531,120
6+
504,21 -> 508,21
7+
492,17 -> 496,17
8+
534,137 -> 538,137
9+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
10+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
11+
469,37 -> 469,38 -> 487,38 -> 487,37
12+
548,160 -> 548,161 -> 561,161 -> 561,160
13+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
14+
497,76 -> 497,80 -> 494,80 -> 494,86 -> 508,86 -> 508,80 -> 503,80 -> 503,76
15+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
16+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
17+
525,120 -> 525,122 -> 522,122 -> 522,130 -> 535,130 -> 535,122 -> 531,122 -> 531,120
18+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
19+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
20+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
21+
469,37 -> 469,38 -> 487,38 -> 487,37
22+
537,139 -> 537,140 -> 548,140 -> 548,139
23+
523,117 -> 527,117
24+
501,15 -> 505,15
25+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
26+
497,76 -> 497,80 -> 494,80 -> 494,86 -> 508,86 -> 508,80 -> 503,80 -> 503,76
27+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
28+
545,146 -> 545,150 -> 537,150 -> 537,156 -> 551,156 -> 551,150 -> 548,150 -> 548,146
29+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
30+
492,21 -> 496,21
31+
548,160 -> 548,161 -> 561,161 -> 561,160
32+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
33+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
34+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
35+
525,120 -> 525,122 -> 522,122 -> 522,130 -> 535,130 -> 535,122 -> 531,122 -> 531,120
36+
469,37 -> 469,38 -> 487,38 -> 487,37
37+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
38+
525,120 -> 525,122 -> 522,122 -> 522,130 -> 535,130 -> 535,122 -> 531,122 -> 531,120
39+
481,45 -> 486,45
40+
495,15 -> 499,15
41+
525,120 -> 525,122 -> 522,122 -> 522,130 -> 535,130 -> 535,122 -> 531,122 -> 531,120
42+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
43+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
44+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
45+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
46+
547,143 -> 552,143
47+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
48+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
49+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
50+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
51+
545,146 -> 545,150 -> 537,150 -> 537,156 -> 551,156 -> 551,150 -> 548,150 -> 548,146
52+
511,117 -> 515,117
53+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
54+
484,43 -> 489,43
55+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
56+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
57+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
58+
498,17 -> 502,17
59+
489,19 -> 493,19
60+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
61+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
62+
497,76 -> 497,80 -> 494,80 -> 494,86 -> 508,86 -> 508,80 -> 503,80 -> 503,76
63+
525,120 -> 525,122 -> 522,122 -> 522,130 -> 535,130 -> 535,122 -> 531,122 -> 531,120
64+
545,146 -> 545,150 -> 537,150 -> 537,156 -> 551,156 -> 551,150 -> 548,150 -> 548,146
65+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
66+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
67+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
68+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
69+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
70+
537,139 -> 537,140 -> 548,140 -> 548,139
71+
537,139 -> 537,140 -> 548,140 -> 548,139
72+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
73+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
74+
497,76 -> 497,80 -> 494,80 -> 494,86 -> 508,86 -> 508,80 -> 503,80 -> 503,76
75+
498,21 -> 502,21
76+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
77+
545,146 -> 545,150 -> 537,150 -> 537,156 -> 551,156 -> 551,150 -> 548,150 -> 548,146
78+
517,113 -> 521,113
79+
534,133 -> 538,133
80+
545,146 -> 545,150 -> 537,150 -> 537,156 -> 551,156 -> 551,150 -> 548,150 -> 548,146
81+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
82+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
83+
507,19 -> 511,19
84+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
85+
517,117 -> 521,117
86+
504,17 -> 508,17
87+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
88+
487,41 -> 492,41
89+
507,89 -> 507,93 -> 499,93 -> 499,97 -> 516,97 -> 516,93 -> 510,93 -> 510,89
90+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
91+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
92+
507,89 -> 507,93 -> 499,93 -> 499,97 -> 516,97 -> 516,93 -> 510,93 -> 510,89
93+
478,47 -> 483,47
94+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
95+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
96+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
97+
492,47 -> 497,47
98+
545,146 -> 545,150 -> 537,150 -> 537,156 -> 551,156 -> 551,150 -> 548,150 -> 548,146
99+
488,45 -> 493,45
100+
525,120 -> 525,122 -> 522,122 -> 522,130 -> 535,130 -> 535,122 -> 531,122 -> 531,120
101+
491,43 -> 496,43
102+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
103+
507,89 -> 507,93 -> 499,93 -> 499,97 -> 516,97 -> 516,93 -> 510,93 -> 510,89
104+
486,21 -> 490,21
105+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
106+
537,135 -> 541,135
107+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
108+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
109+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
110+
531,135 -> 535,135
111+
497,76 -> 497,80 -> 494,80 -> 494,86 -> 508,86 -> 508,80 -> 503,80 -> 503,76
112+
507,89 -> 507,93 -> 499,93 -> 499,97 -> 516,97 -> 516,93 -> 510,93 -> 510,89
113+
499,47 -> 504,47
114+
507,89 -> 507,93 -> 499,93 -> 499,97 -> 516,97 -> 516,93 -> 510,93 -> 510,89
115+
514,110 -> 514,103 -> 514,110 -> 516,110 -> 516,101 -> 516,110 -> 518,110 -> 518,105 -> 518,110
116+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
117+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
118+
497,76 -> 497,80 -> 494,80 -> 494,86 -> 508,86 -> 508,80 -> 503,80 -> 503,76
119+
501,19 -> 505,19
120+
495,45 -> 500,45
121+
540,137 -> 544,137
122+
520,115 -> 524,115
123+
510,21 -> 514,21
124+
485,47 -> 490,47
125+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
126+
507,89 -> 507,93 -> 499,93 -> 499,97 -> 516,97 -> 516,93 -> 510,93 -> 510,89
127+
491,73 -> 491,63 -> 491,73 -> 493,73 -> 493,65 -> 493,73 -> 495,73 -> 495,68 -> 495,73 -> 497,73 -> 497,67 -> 497,73 -> 499,73 -> 499,68 -> 499,73
128+
548,160 -> 548,161 -> 561,161 -> 561,160
129+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
130+
495,19 -> 499,19
131+
514,115 -> 518,115
132+
507,89 -> 507,93 -> 499,93 -> 499,97 -> 516,97 -> 516,93 -> 510,93 -> 510,89
133+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
134+
479,34 -> 479,32 -> 479,34 -> 481,34 -> 481,30 -> 481,34 -> 483,34 -> 483,26 -> 483,34 -> 485,34 -> 485,25 -> 485,34 -> 487,34 -> 487,26 -> 487,34 -> 489,34 -> 489,32 -> 489,34
135+
497,60 -> 497,59 -> 497,60 -> 499,60 -> 499,55 -> 499,60 -> 501,60 -> 501,54 -> 501,60 -> 503,60 -> 503,53 -> 503,60 -> 505,60 -> 505,53 -> 505,60 -> 507,60 -> 507,52 -> 507,60 -> 509,60 -> 509,53 -> 509,60 -> 511,60 -> 511,58 -> 511,60
136+
528,137 -> 532,137
137+
545,146 -> 545,150 -> 537,150 -> 537,156 -> 551,156 -> 551,150 -> 548,150 -> 548,146

day14/part1.rkt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#lang racket
2+
3+
(require "../aoc.rkt")
4+
5+
(define (line->points line)
6+
(map (compose (curry map string->number) (curryr string-split ",")) (string-split line " -> " )))
7+
8+
(define (addrange p points)
9+
(let ([ax (first (first points))]
10+
[ay (second (first points))]
11+
[bx (+ 1 (first p))]
12+
[by (+ 1 (second p))])
13+
(for/fold ([points points]) ([x (range ax bx)][y (range ay by)])
14+
(cons (list x y) points))))
15+
16+
(define (expand points)
17+
(foldl addrange (list (first points)) points))
18+
19+
(define (add2cave points cave)
20+
(foldl (lambda (p h) (hash-set h p "#")) (hash) points))
21+
22+
(define (solve lines)
23+
(let* ([endpoints (map line->points lines)]
24+
[points (map expand endpoints)]
25+
[cave (foldl add2cave (hash) (insp points))])
26+
cave))
27+
28+
29+
(call-with-lines "input" solve)

0 commit comments

Comments
 (0)