Day 14
This commit is contained in:
parent
c6e5343b52
commit
3de6c685b3
173
input/14.txt
Normal file
173
input/14.txt
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
480,150 -> 485,150
|
||||||
|
459,100 -> 464,100
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
504,19 -> 508,19
|
||||||
|
467,59 -> 472,59
|
||||||
|
463,103 -> 468,103
|
||||||
|
472,68 -> 477,68
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
470,103 -> 475,103
|
||||||
|
479,36 -> 479,40 -> 477,40 -> 477,48 -> 489,48 -> 489,40 -> 483,40 -> 483,36
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
467,128 -> 467,132 -> 462,132 -> 462,138 -> 477,138 -> 477,132 -> 472,132 -> 472,128
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
452,112 -> 458,112 -> 458,111
|
||||||
|
460,115 -> 460,117 -> 456,117 -> 456,125 -> 469,125 -> 469,117 -> 464,117 -> 464,115
|
||||||
|
486,25 -> 490,25
|
||||||
|
471,109 -> 476,109
|
||||||
|
467,179 -> 467,180 -> 472,180 -> 472,179
|
||||||
|
487,150 -> 492,150
|
||||||
|
501,16 -> 505,16
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
479,36 -> 479,40 -> 477,40 -> 477,48 -> 489,48 -> 489,40 -> 483,40 -> 483,36
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
464,109 -> 469,109
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
489,22 -> 493,22
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
460,115 -> 460,117 -> 456,117 -> 456,125 -> 469,125 -> 469,117 -> 464,117 -> 464,115
|
||||||
|
471,55 -> 471,56 -> 479,56
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
498,25 -> 502,25
|
||||||
|
467,128 -> 467,132 -> 462,132 -> 462,138 -> 477,138 -> 477,132 -> 472,132 -> 472,128
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
498,13 -> 502,13
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
472,144 -> 477,144
|
||||||
|
466,150 -> 471,150
|
||||||
|
479,36 -> 479,40 -> 477,40 -> 477,48 -> 489,48 -> 489,40 -> 483,40 -> 483,36
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
507,22 -> 511,22
|
||||||
|
467,128 -> 467,132 -> 462,132 -> 462,138 -> 477,138 -> 477,132 -> 472,132 -> 472,128
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
479,36 -> 479,40 -> 477,40 -> 477,48 -> 489,48 -> 489,40 -> 483,40 -> 483,36
|
||||||
|
498,19 -> 502,19
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
458,68 -> 463,68
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
475,65 -> 480,65
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
492,19 -> 496,19
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
460,115 -> 460,117 -> 456,117 -> 456,125 -> 469,125 -> 469,117 -> 464,117 -> 464,115
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
467,128 -> 467,132 -> 462,132 -> 462,138 -> 477,138 -> 477,132 -> 472,132 -> 472,128
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
466,100 -> 471,100
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
464,62 -> 469,62
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
456,103 -> 461,103
|
||||||
|
484,28 -> 484,30 -> 481,30 -> 481,33 -> 488,33 -> 488,30 -> 487,30 -> 487,28
|
||||||
|
467,179 -> 467,180 -> 472,180 -> 472,179
|
||||||
|
467,128 -> 467,132 -> 462,132 -> 462,138 -> 477,138 -> 477,132 -> 472,132 -> 472,128
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
467,106 -> 472,106
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
474,50 -> 474,51 -> 486,51
|
||||||
|
468,65 -> 473,65
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
479,68 -> 484,68
|
||||||
|
476,147 -> 481,147
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
453,106 -> 458,106
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
484,28 -> 484,30 -> 481,30 -> 481,33 -> 488,33 -> 488,30 -> 487,30 -> 487,28
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
484,28 -> 484,30 -> 481,30 -> 481,33 -> 488,33 -> 488,30 -> 487,30 -> 487,28
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
483,147 -> 488,147
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
501,22 -> 505,22
|
||||||
|
465,68 -> 470,68
|
||||||
|
479,144 -> 484,144
|
||||||
|
484,28 -> 484,30 -> 481,30 -> 481,33 -> 488,33 -> 488,30 -> 487,30 -> 487,28
|
||||||
|
484,28 -> 484,30 -> 481,30 -> 481,33 -> 488,33 -> 488,30 -> 487,30 -> 487,28
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
474,106 -> 479,106
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
471,55 -> 471,56 -> 479,56
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
475,141 -> 480,141
|
||||||
|
460,115 -> 460,117 -> 456,117 -> 456,125 -> 469,125 -> 469,117 -> 464,117 -> 464,115
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
484,28 -> 484,30 -> 481,30 -> 481,33 -> 488,33 -> 488,30 -> 487,30 -> 487,28
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
457,109 -> 462,109
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
467,128 -> 467,132 -> 462,132 -> 462,138 -> 477,138 -> 477,132 -> 472,132 -> 472,128
|
||||||
|
504,25 -> 508,25
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
495,22 -> 499,22
|
||||||
|
492,25 -> 496,25
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
467,128 -> 467,132 -> 462,132 -> 462,138 -> 477,138 -> 477,132 -> 472,132 -> 472,128
|
||||||
|
460,106 -> 465,106
|
||||||
|
469,147 -> 474,147
|
||||||
|
450,109 -> 455,109
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
452,112 -> 458,112 -> 458,111
|
||||||
|
461,65 -> 466,65
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
467,179 -> 467,180 -> 472,180 -> 472,179
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
460,115 -> 460,117 -> 456,117 -> 456,125 -> 469,125 -> 469,117 -> 464,117 -> 464,115
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
462,97 -> 467,97
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
510,25 -> 514,25
|
||||||
|
495,16 -> 499,16
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
458,81 -> 458,77 -> 458,81 -> 460,81 -> 460,73 -> 460,81 -> 462,81 -> 462,80 -> 462,81 -> 464,81 -> 464,77 -> 464,81 -> 466,81 -> 466,78 -> 466,81 -> 468,81 -> 468,73 -> 468,81
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
479,36 -> 479,40 -> 477,40 -> 477,48 -> 489,48 -> 489,40 -> 483,40 -> 483,36
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
472,176 -> 472,175 -> 472,176 -> 474,176 -> 474,174 -> 474,176 -> 476,176 -> 476,174 -> 476,176 -> 478,176 -> 478,175 -> 478,176 -> 480,176 -> 480,166 -> 480,176 -> 482,176 -> 482,172 -> 482,176 -> 484,176 -> 484,167 -> 484,176
|
||||||
|
460,115 -> 460,117 -> 456,117 -> 456,125 -> 469,125 -> 469,117 -> 464,117 -> 464,115
|
||||||
|
448,94 -> 448,87 -> 448,94 -> 450,94 -> 450,93 -> 450,94 -> 452,94 -> 452,91 -> 452,94 -> 454,94 -> 454,88 -> 454,94 -> 456,94 -> 456,91 -> 456,94 -> 458,94 -> 458,86 -> 458,94 -> 460,94 -> 460,86 -> 460,94 -> 462,94 -> 462,89 -> 462,94 -> 464,94 -> 464,90 -> 464,94
|
||||||
|
479,36 -> 479,40 -> 477,40 -> 477,48 -> 489,48 -> 489,40 -> 483,40 -> 483,36
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
464,163 -> 464,158 -> 464,163 -> 466,163 -> 466,154 -> 466,163 -> 468,163 -> 468,153 -> 468,163 -> 470,163 -> 470,160 -> 470,163 -> 472,163 -> 472,162 -> 472,163 -> 474,163 -> 474,159 -> 474,163 -> 476,163 -> 476,155 -> 476,163 -> 478,163 -> 478,159 -> 478,163
|
||||||
|
473,150 -> 478,150
|
||||||
|
471,62 -> 476,62
|
||||||
|
484,28 -> 484,30 -> 481,30 -> 481,33 -> 488,33 -> 488,30 -> 487,30 -> 487,28
|
||||||
|
479,36 -> 479,40 -> 477,40 -> 477,48 -> 489,48 -> 489,40 -> 483,40 -> 483,36
|
||||||
|
478,109 -> 483,109
|
||||||
|
474,50 -> 474,51 -> 486,51
|
||||||
|
460,115 -> 460,117 -> 456,117 -> 456,125 -> 469,125 -> 469,117 -> 464,117 -> 464,115
|
@ -56,7 +56,7 @@ pub fn run() {
|
|||||||
.filter(|(_, pair)| pair.in_order())
|
.filter(|(_, pair)| pair.in_order())
|
||||||
.map(|(idx, _)| idx + 1)
|
.map(|(idx, _)| idx + 1)
|
||||||
.sum::<usize>();
|
.sum::<usize>();
|
||||||
println!("Day 12, Part 01: {:?}", p1);
|
println!("Day 13, Part 01: {:?}", p1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "part2")]
|
#[cfg(feature = "part2")]
|
||||||
@ -74,7 +74,7 @@ pub fn run() {
|
|||||||
let product =
|
let product =
|
||||||
(p2.binary_search(&div1).unwrap() + 1) * (p2.binary_search(&div2).unwrap() + 1);
|
(p2.binary_search(&div1).unwrap() + 1) * (p2.binary_search(&div2).unwrap() + 1);
|
||||||
|
|
||||||
println!("Day 12, Part 02: {:?}", product);
|
println!("Day 13, Part 02: {:?}", product);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
217
src/day14/mod.rs
Normal file
217
src/day14/mod.rs
Normal file
@ -0,0 +1,217 @@
|
|||||||
|
use crate::read;
|
||||||
|
use itertools::Itertools;
|
||||||
|
use std::collections::*;
|
||||||
|
use std::hash::{Hash, Hasher};
|
||||||
|
use std::io::Write;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Eq)]
|
||||||
|
pub struct Coord {
|
||||||
|
pub x: i32,
|
||||||
|
pub y: usize,
|
||||||
|
pub is_rock: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Hash for Coord {
|
||||||
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
|
self.x.hash(state);
|
||||||
|
self.y.hash(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PartialEq for Coord {
|
||||||
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
self.x == other.x && self.y == other.y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Coord {
|
||||||
|
pub fn down_left(&self) -> Self {
|
||||||
|
Coord {
|
||||||
|
x: self.x - 1,
|
||||||
|
y: self.y + 1,
|
||||||
|
is_rock: self.is_rock,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn down_right(&self) -> Self {
|
||||||
|
Coord {
|
||||||
|
x: self.x + 1,
|
||||||
|
y: self.y + 1,
|
||||||
|
is_rock: self.is_rock,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn down(&self) -> Self {
|
||||||
|
Coord {
|
||||||
|
x: self.x,
|
||||||
|
y: self.y + 1,
|
||||||
|
is_rock: self.is_rock,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn run() {
|
||||||
|
let input = read("14");
|
||||||
|
let lines = input.lines();
|
||||||
|
let mut rocks: HashSet<Coord> = lines
|
||||||
|
.flat_map(|line| {
|
||||||
|
line.split(" -> ")
|
||||||
|
.map(|c| {
|
||||||
|
let nums = c.split_once(',').unwrap();
|
||||||
|
Coord {
|
||||||
|
x: nums.0.parse().unwrap(),
|
||||||
|
y: nums.1.parse().unwrap(),
|
||||||
|
is_rock: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.tuple_windows()
|
||||||
|
.flat_map(|(s, e)| {
|
||||||
|
let mut path = vec![];
|
||||||
|
for nx in s.x..=e.x {
|
||||||
|
for ny in s.y..=e.y {
|
||||||
|
path.push(Coord {
|
||||||
|
x: nx,
|
||||||
|
y: ny,
|
||||||
|
is_rock: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for nx in e.x..=s.x {
|
||||||
|
for ny in e.y..=s.y {
|
||||||
|
path.push(Coord {
|
||||||
|
x: nx,
|
||||||
|
y: ny,
|
||||||
|
is_rock: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
path
|
||||||
|
})
|
||||||
|
.collect_vec()
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
#[cfg(feature = "part1")]
|
||||||
|
{
|
||||||
|
println!("Day 14, Part 01: {:?}", p1(&mut rocks.clone()));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "part2")]
|
||||||
|
{
|
||||||
|
let floor = rocks.iter().map(|r| r.y).max().unwrap() + 2;
|
||||||
|
for x in -1000..=1000 {
|
||||||
|
rocks.insert(Coord {
|
||||||
|
x,
|
||||||
|
y: floor,
|
||||||
|
is_rock: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
println!("Day 14, Part 02: {:?}", p2(&mut rocks.clone()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn p1(rocks: &mut HashSet<Coord>) -> usize {
|
||||||
|
let bottom = rocks.iter().map(|r| r.y).max().unwrap();
|
||||||
|
let sand_start = Coord {
|
||||||
|
x: 500,
|
||||||
|
y: 0,
|
||||||
|
is_rock: false,
|
||||||
|
};
|
||||||
|
let mut count_p1 = 0;
|
||||||
|
|
||||||
|
loop {
|
||||||
|
let mut sand = sand_start.clone();
|
||||||
|
|
||||||
|
loop {
|
||||||
|
//print(rocks, &sand);
|
||||||
|
if sand.y > bottom {
|
||||||
|
return count_p1;
|
||||||
|
}
|
||||||
|
let d = sand.down();
|
||||||
|
let dl = sand.down_left();
|
||||||
|
let dr = sand.down_right();
|
||||||
|
|
||||||
|
if rocks.contains(&d) {
|
||||||
|
if rocks.contains(&dl) {
|
||||||
|
if rocks.contains(&dr) {
|
||||||
|
count_p1 += 1;
|
||||||
|
rocks.insert(sand.clone());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sand = dr;
|
||||||
|
} else {
|
||||||
|
sand = dl;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sand = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn p2(rocks: &mut HashSet<Coord>) -> usize {
|
||||||
|
let sand_start = Coord {
|
||||||
|
x: 500,
|
||||||
|
y: 0,
|
||||||
|
is_rock: false,
|
||||||
|
};
|
||||||
|
let mut count_p2 = 0;
|
||||||
|
|
||||||
|
loop {
|
||||||
|
let mut sand = sand_start.clone();
|
||||||
|
if rocks.contains(&sand) {
|
||||||
|
return count_p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
loop {
|
||||||
|
let d = sand.down();
|
||||||
|
let dl = sand.down_left();
|
||||||
|
let dr = sand.down_right();
|
||||||
|
|
||||||
|
if rocks.contains(&d) {
|
||||||
|
if rocks.contains(&dl) {
|
||||||
|
if rocks.contains(&dr) {
|
||||||
|
count_p2 += 1;
|
||||||
|
rocks.insert(sand.clone());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sand = dr;
|
||||||
|
} else {
|
||||||
|
sand = dl;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sand = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn print(rocks: &HashSet<Coord>, sand: &Coord) {
|
||||||
|
let min_y = 10;
|
||||||
|
let min_x = 452;
|
||||||
|
let max_y = 180;
|
||||||
|
let max_x = 514;
|
||||||
|
|
||||||
|
let bounds = " ".repeat((max_y as usize) - (min_y as usize));
|
||||||
|
let mut out = format!("\n{}\n", bounds);
|
||||||
|
|
||||||
|
for x in (min_x..=max_x).rev() {
|
||||||
|
for y in min_y..=max_y {
|
||||||
|
let testing = &Coord {
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
is_rock: false,
|
||||||
|
};
|
||||||
|
let c = match (sand == testing, rocks.get(testing)) {
|
||||||
|
(true, _) => 'o',
|
||||||
|
(_, None) => ' ',
|
||||||
|
(_, Some(coord)) if coord.is_rock => '#',
|
||||||
|
_ => 'o',
|
||||||
|
};
|
||||||
|
out += &format!("{}", c);
|
||||||
|
}
|
||||||
|
out += "\n";
|
||||||
|
}
|
||||||
|
out += &bounds;
|
||||||
|
print!("{}", out);
|
||||||
|
std::io::stdout().flush().unwrap();
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(60));
|
||||||
|
}
|
@ -14,6 +14,7 @@ mod day10;
|
|||||||
mod day11;
|
mod day11;
|
||||||
mod day12;
|
mod day12;
|
||||||
mod day13;
|
mod day13;
|
||||||
|
mod day14;
|
||||||
mod puter;
|
mod puter;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -58,6 +59,9 @@ fn main() {
|
|||||||
if cfg!(feature = "day13") || (cfg!(feature = "today") && today == 13) {
|
if cfg!(feature = "day13") || (cfg!(feature = "today") && today == 13) {
|
||||||
day13::run();
|
day13::run();
|
||||||
}
|
}
|
||||||
|
if cfg!(feature = "day14") || (cfg!(feature = "today") && today == 14) {
|
||||||
|
day14::run();
|
||||||
|
}
|
||||||
println!("Finished, time taken: {:?}", now.elapsed())
|
println!("Finished, time taken: {:?}", now.elapsed())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user