diff --git a/cave.txt b/cave.txt new file mode 100644 index 0000000..8bb849c --- /dev/null +++ b/cave.txt @@ -0,0 +1,163 @@ +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +491,32 -> 495,32 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +515,103 -> 515,107 -> 512,107 -> 512,115 -> 523,115 -> 523,107 -> 520,107 -> 520,103 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +556,167 -> 556,168 -> 566,168 -> 566,167 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +483,23 -> 498,23 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +485,38 -> 489,38 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +557,171 -> 557,172 -> 573,172 -> 573,171 +480,47 -> 480,50 -> 472,50 -> 472,56 -> 489,56 -> 489,50 -> 483,50 -> 483,47 +500,74 -> 504,74 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +497,26 -> 501,26 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +497,76 -> 501,76 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +491,76 -> 495,76 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +515,103 -> 515,107 -> 512,107 -> 512,115 -> 523,115 -> 523,107 -> 520,107 -> 520,103 +556,167 -> 556,168 -> 566,168 -> 566,167 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +494,35 -> 498,35 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +497,38 -> 501,38 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +488,35 -> 492,35 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +522,122 -> 527,122 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +480,47 -> 480,50 -> 472,50 -> 472,56 -> 489,56 -> 489,50 -> 483,50 -> 483,47 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +503,76 -> 507,76 +511,92 -> 511,95 -> 507,95 -> 507,100 -> 517,100 -> 517,95 -> 514,95 -> 514,92 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +515,103 -> 515,107 -> 512,107 -> 512,115 -> 523,115 -> 523,107 -> 520,107 -> 520,103 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +488,59 -> 488,61 -> 485,61 -> 485,69 -> 498,69 -> 498,61 -> 493,61 -> 493,59 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +519,124 -> 524,124 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +494,74 -> 498,74 +525,120 -> 530,120 +480,47 -> 480,50 -> 472,50 -> 472,56 -> 489,56 -> 489,50 -> 483,50 -> 483,47 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +480,47 -> 480,50 -> 472,50 -> 472,56 -> 489,56 -> 489,50 -> 483,50 -> 483,47 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +509,38 -> 513,38 +533,124 -> 538,124 +488,59 -> 488,61 -> 485,61 -> 485,69 -> 498,69 -> 498,61 -> 493,61 -> 493,59 +480,47 -> 480,50 -> 472,50 -> 472,56 -> 489,56 -> 489,50 -> 483,50 -> 483,47 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +488,59 -> 488,61 -> 485,61 -> 485,69 -> 498,69 -> 498,61 -> 493,61 -> 493,59 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +494,29 -> 498,29 +482,43 -> 482,44 -> 487,44 +515,103 -> 515,107 -> 512,107 -> 512,115 -> 523,115 -> 523,107 -> 520,107 -> 520,103 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +521,118 -> 526,118 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +515,103 -> 515,107 -> 512,107 -> 512,115 -> 523,115 -> 523,107 -> 520,107 -> 520,103 +515,122 -> 520,122 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +557,171 -> 557,172 -> 573,172 -> 573,171 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +488,59 -> 488,61 -> 485,61 -> 485,69 -> 498,69 -> 498,61 -> 493,61 -> 493,59 +511,92 -> 511,95 -> 507,95 -> 507,100 -> 517,100 -> 517,95 -> 514,95 -> 514,92 +480,47 -> 480,50 -> 472,50 -> 472,56 -> 489,56 -> 489,50 -> 483,50 -> 483,47 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +518,120 -> 523,120 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +488,59 -> 488,61 -> 485,61 -> 485,69 -> 498,69 -> 498,61 -> 493,61 -> 493,59 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +498,19 -> 502,19 +501,16 -> 505,16 +511,92 -> 511,95 -> 507,95 -> 507,100 -> 517,100 -> 517,95 -> 514,95 -> 514,92 +488,59 -> 488,61 -> 485,61 -> 485,69 -> 498,69 -> 498,61 -> 493,61 -> 493,59 +515,103 -> 515,107 -> 512,107 -> 512,115 -> 523,115 -> 523,107 -> 520,107 -> 520,103 +482,43 -> 482,44 -> 487,44 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +480,47 -> 480,50 -> 472,50 -> 472,56 -> 489,56 -> 489,50 -> 483,50 -> 483,47 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +503,38 -> 507,38 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +506,35 -> 510,35 +556,167 -> 556,168 -> 566,168 -> 566,167 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +504,19 -> 508,19 +492,19 -> 496,19 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +500,35 -> 504,35 +495,16 -> 499,16 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +500,29 -> 504,29 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +511,92 -> 511,95 -> 507,95 -> 507,100 -> 517,100 -> 517,95 -> 514,95 -> 514,92 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +511,92 -> 511,95 -> 507,95 -> 507,100 -> 517,100 -> 517,95 -> 514,95 -> 514,92 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +512,124 -> 517,124 +557,171 -> 557,172 -> 573,172 -> 573,171 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +511,92 -> 511,95 -> 507,95 -> 507,100 -> 517,100 -> 517,95 -> 514,95 -> 514,92 +529,122 -> 534,122 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +503,32 -> 507,32 +491,38 -> 495,38 +497,32 -> 501,32 +526,124 -> 531,124 +515,103 -> 515,107 -> 512,107 -> 512,115 -> 523,115 -> 523,107 -> 520,107 -> 520,103 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +511,92 -> 511,95 -> 507,95 -> 507,100 -> 517,100 -> 517,95 -> 514,95 -> 514,92 +544,163 -> 544,161 -> 544,163 -> 546,163 -> 546,153 -> 546,163 -> 548,163 -> 548,158 -> 548,163 -> 550,163 -> 550,159 -> 550,163 -> 552,163 -> 552,161 -> 552,163 -> 554,163 -> 554,159 -> 554,163 -> 556,163 -> 556,158 -> 556,163 -> 558,163 -> 558,156 -> 558,163 -> 560,163 -> 560,156 -> 560,163 +534,150 -> 534,145 -> 534,150 -> 536,150 -> 536,147 -> 536,150 -> 538,150 -> 538,146 -> 538,150 -> 540,150 -> 540,146 -> 540,150 -> 542,150 -> 542,146 -> 542,150 -> 544,150 -> 544,144 -> 544,150 -> 546,150 -> 546,141 -> 546,150 -> 548,150 -> 548,143 -> 548,150 -> 550,150 -> 550,143 -> 550,150 -> 552,150 -> 552,141 -> 552,150 +497,72 -> 501,72 +498,13 -> 502,13 +533,137 -> 533,135 -> 533,137 -> 535,137 -> 535,131 -> 535,137 -> 537,137 -> 537,128 -> 537,137 -> 539,137 -> 539,130 -> 539,137 -> 541,137 -> 541,135 -> 541,137 -> 543,137 -> 543,135 -> 543,137 +488,59 -> 488,61 -> 485,61 -> 485,69 -> 498,69 -> 498,61 -> 493,61 -> 493,59 +502,89 -> 502,79 -> 502,89 -> 504,89 -> 504,84 -> 504,89 -> 506,89 -> 506,85 -> 506,89 -> 508,89 -> 508,86 -> 508,89 -> 510,89 -> 510,88 -> 510,89 -> 512,89 -> 512,85 -> 512,89 \ No newline at end of file diff --git a/day14.c3 b/day14.c3 new file mode 100644 index 0000000..b1185d8 --- /dev/null +++ b/day14.c3 @@ -0,0 +1,128 @@ +module day14; +import std::io; +import std::math; + +const ENV_SIDE = 1000; +define Environment = int[ENV_SIDE][ENV_SIDE]; + +enum Result +{ + LOST_IN_ABYSS, + CAME_TO_REST, + SAND_CHOKED, +} + +enum EnvType +{ + HAS_ABYSS, + INFINITY_CUTOFF +} + +fn int[<2>]! str_to_coord(char[] str) +{ + char[][] parts = str::tsplit(str, ","); + return { str::to_int(parts[0]), str::to_int(parts[1]) }; +} + +fn Environment* load_environment(EnvType type) +{ + File f; + f.open("cave.txt", "rb")!!; + defer catch(f.close()); + Environment* env = calloc(Environment.sizeof); + int max_y = 0; + while (!f.eof()) + { + @pool() + { + char[] line = f.tgetline(); + int[<2>] last = { 0, 0 }; + foreach (part : str::tsplit(line, " -> ")) + { + int[<2>] next = str_to_coord(part)!!; + if (next[1] > max_y) max_y = next[1]; + if (!last[0]) + { + env[next[0]][next[1]] = -1; + last = next; + continue; + } + int[<2>] diff = { math::sign(next[0] - last[0]), math::sign(next[1] - last[1]) }; + while (!$$reduce_and(last == next)) + { + last += diff; + env[last[0]][last[1]] = -1; + } + } + }; + } + if (type == EnvType.INFINITY_CUTOFF) + { + for (int i = 0; i < ENV_SIDE; i++) + { + env[i][max_y + 2] = -1; + } + } + return env; +} + + +fn Result simulate_sand_path(Environment* env, int[<2>] sand) +{ + int[<2>] start = sand; + while (true) + { + switch + { + case (!env[sand[0]][sand[1] + 1]): + sand[1]++; + case (!env[sand[0] - 1][sand[1] + 1]): + sand += { -1, 1 }; + case (!env[sand[0] + 1][sand[1] + 1]): + sand += { 1 , 1 }; + default: + if ($$reduce_and(start == sand)) return SAND_CHOKED; + env[sand[0]][sand[1]] = 1; + return CAME_TO_REST; + } + if (sand[1] == ENV_SIDE - 1 || sand[0] == 0 || sand[0] == ENV_SIDE - 1) return LOST_IN_ABYSS; + } +} + +fn void part1() +{ + Environment *env = load_environment(EnvType.HAS_ABYSS); + const int[<2>] SAND_START = { 500, 0 }; + int grains_of_sand = 0; + while (true) + { + if (simulate_sand_path(env, SAND_START) == Result.LOST_IN_ABYSS) + { + io::printfln("%d grains of sand came to rest.", grains_of_sand); + return; + } + grains_of_sand++; + } +} + +fn void part2() +{ + Environment *env = load_environment(EnvType.INFINITY_CUTOFF); + const int[<2>] SAND_START = { 500, 0 }; + int grains_of_sand = 0; + while (true) + { + grains_of_sand++; + if (simulate_sand_path(env, SAND_START) == Result.SAND_CHOKED) + { + io::printfln("%d grains of sand came to rest.", grains_of_sand); + return; + } + } +} + +fn void main() +{ + part1(); + part2(); +} \ No newline at end of file