From ed89358501e897218d129933cd0b1a837ab796b0 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 11 Dec 2015 17:44:08 -0500 Subject: [PATCH] Day 6 WIP --- advent-of-code.org | 752 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 752 insertions(+) diff --git a/advent-of-code.org b/advent-of-code.org index cdcbe38..d9b93fa 100644 --- a/advent-of-code.org +++ b/advent-of-code.org @@ -2634,3 +2634,755 @@ How many strings are nice under these new rules? #+RESULTS[714e53b40cf4a27435a59eafbd8c488cb05bd539]: : 55 + +* Day 6: Probably a Fire Hazard + +Because your neighbors keep defeating you in the holiday house +decorating contest year after year, you've decided to deploy one +million lights in a 1000x1000 grid. + +Furthermore, because you've been especially nice this year, Santa has +mailed you instructions on how to display the ideal lighting +configuration. + +Lights in your grid are numbered from 0 to 999 in each direction; the +lights at each corner are at =0,0=, =0,999=, =999,999=, and =999,0=. +The instructions include whether to =turn on=, =turn off=, or =toggle= +various inclusive ranges given as coordinate pairs. Each coordinate +pair represents opposite corners of a rectangle, inclusive; a +coordinate pair like =0,0= through =2,2= therefore refers to 9 lights +in a 3x3 square. The lights all start turned off. + +To defeat your neighbors this year, all you have to do is set up your +lights by doing the instructions Santa sent you in order. + +For example: + +- =turn on 0,0 through 999,999= would turn on (or leave on) every + light. +- =toggle 0,0 through 999,0= would toggle the first line of 1000 + lights, turning off the ones that were on, and turning on the ones + that were off. +- =turn off 499,499 through 500,500= would turn off (or leave off) the + middle four lights. + +After following the instructions, how many lights are lit? + +---------------------------------------------------------------------- + +:HIDDEN: +#+name: 6-input +#+BEGIN_EXAMPLE + turn on 887,9 through 959,629 + turn on 454,398 through 844,448 + turn off 539,243 through 559,965 + turn off 370,819 through 676,868 + turn off 145,40 through 370,997 + turn off 301,3 through 808,453 + turn on 351,678 through 951,908 + toggle 720,196 through 897,994 + toggle 831,394 through 904,860 + toggle 753,664 through 970,926 + turn off 150,300 through 213,740 + turn on 141,242 through 932,871 + toggle 294,259 through 474,326 + toggle 678,333 through 752,957 + toggle 393,804 through 510,976 + turn off 6,964 through 411,976 + turn off 33,572 through 978,590 + turn on 579,693 through 650,978 + turn on 150,20 through 652,719 + turn off 782,143 through 808,802 + turn off 240,377 through 761,468 + turn off 899,828 through 958,967 + turn on 613,565 through 952,659 + turn on 295,36 through 964,978 + toggle 846,296 through 969,528 + turn off 211,254 through 529,491 + turn off 231,594 through 406,794 + turn off 169,791 through 758,942 + turn on 955,440 through 980,477 + toggle 944,498 through 995,928 + turn on 519,391 through 605,718 + toggle 521,303 through 617,366 + turn off 524,349 through 694,791 + toggle 391,87 through 499,792 + toggle 562,527 through 668,935 + turn off 68,358 through 857,453 + toggle 815,811 through 889,828 + turn off 666,61 through 768,87 + turn on 27,501 through 921,952 + turn on 953,102 through 983,471 + turn on 277,552 through 451,723 + turn off 64,253 through 655,960 + turn on 47,485 through 734,977 + turn off 59,119 through 699,734 + toggle 407,898 through 493,955 + toggle 912,966 through 949,991 + turn on 479,990 through 895,990 + toggle 390,589 through 869,766 + toggle 593,903 through 926,943 + toggle 358,439 through 870,528 + turn off 649,410 through 652,875 + turn on 629,834 through 712,895 + toggle 254,555 through 770,901 + toggle 641,832 through 947,850 + turn on 268,448 through 743,777 + turn off 512,123 through 625,874 + turn off 498,262 through 930,811 + turn off 835,158 through 886,242 + toggle 546,310 through 607,773 + turn on 501,505 through 896,909 + turn off 666,796 through 817,924 + toggle 987,789 through 993,809 + toggle 745,8 through 860,693 + toggle 181,983 through 731,988 + turn on 826,174 through 924,883 + turn on 239,228 through 843,993 + turn on 205,613 through 891,667 + toggle 867,873 through 984,896 + turn on 628,251 through 677,681 + toggle 276,956 through 631,964 + turn on 78,358 through 974,713 + turn on 521,360 through 773,597 + turn off 963,52 through 979,502 + turn on 117,151 through 934,622 + toggle 237,91 through 528,164 + turn on 944,269 through 975,453 + toggle 979,460 through 988,964 + turn off 440,254 through 681,507 + toggle 347,100 through 896,785 + turn off 329,592 through 369,985 + turn on 931,960 through 979,985 + toggle 703,3 through 776,36 + toggle 798,120 through 908,550 + turn off 186,605 through 914,709 + turn off 921,725 through 979,956 + toggle 167,34 through 735,249 + turn on 726,781 through 987,936 + toggle 720,336 through 847,756 + turn on 171,630 through 656,769 + turn off 417,276 through 751,500 + toggle 559,485 through 584,534 + turn on 568,629 through 690,873 + toggle 248,712 through 277,988 + toggle 345,594 through 812,723 + turn off 800,108 through 834,618 + turn off 967,439 through 986,869 + turn on 842,209 through 955,529 + turn on 132,653 through 357,696 + turn on 817,38 through 973,662 + turn off 569,816 through 721,861 + turn on 568,429 through 945,724 + turn on 77,458 through 844,685 + turn off 138,78 through 498,851 + turn on 136,21 through 252,986 + turn off 2,460 through 863,472 + turn on 172,81 through 839,332 + turn on 123,216 through 703,384 + turn off 879,644 through 944,887 + toggle 227,491 through 504,793 + toggle 580,418 through 741,479 + toggle 65,276 through 414,299 + toggle 482,486 through 838,931 + turn off 557,768 through 950,927 + turn off 615,617 through 955,864 + turn on 859,886 through 923,919 + turn on 391,330 through 499,971 + toggle 521,835 through 613,847 + turn on 822,787 through 989,847 + turn on 192,142 through 357,846 + turn off 564,945 through 985,945 + turn off 479,361 through 703,799 + toggle 56,481 through 489,978 + turn off 632,991 through 774,998 + toggle 723,526 through 945,792 + turn on 344,149 through 441,640 + toggle 568,927 through 624,952 + turn on 621,784 through 970,788 + toggle 665,783 through 795,981 + toggle 386,610 through 817,730 + toggle 440,399 through 734,417 + toggle 939,201 through 978,803 + turn off 395,883 through 554,929 + turn on 340,309 through 637,561 + turn off 875,147 through 946,481 + turn off 945,837 through 957,922 + turn off 429,982 through 691,991 + toggle 227,137 through 439,822 + toggle 4,848 through 7,932 + turn off 545,146 through 756,943 + turn on 763,863 through 937,994 + turn on 232,94 through 404,502 + turn off 742,254 through 930,512 + turn on 91,931 through 101,942 + toggle 585,106 through 651,425 + turn on 506,700 through 567,960 + turn off 548,44 through 718,352 + turn off 194,827 through 673,859 + turn off 6,645 through 509,764 + turn off 13,230 through 821,361 + turn on 734,629 through 919,631 + toggle 788,552 through 957,972 + toggle 244,747 through 849,773 + turn off 162,553 through 276,887 + turn off 569,577 through 587,604 + turn off 799,482 through 854,956 + turn on 744,535 through 909,802 + toggle 330,641 through 396,986 + turn off 927,458 through 966,564 + toggle 984,486 through 986,913 + toggle 519,682 through 632,708 + turn on 984,977 through 989,986 + toggle 766,423 through 934,495 + turn on 17,509 through 947,718 + turn on 413,783 through 631,903 + turn on 482,370 through 493,688 + turn on 433,859 through 628,938 + turn off 769,549 through 945,810 + turn on 178,853 through 539,941 + turn off 203,251 through 692,433 + turn off 525,638 through 955,794 + turn on 169,70 through 764,939 + toggle 59,352 through 896,404 + toggle 143,245 through 707,320 + turn off 103,35 through 160,949 + toggle 496,24 through 669,507 + turn off 581,847 through 847,903 + turn on 689,153 through 733,562 + turn on 821,487 through 839,699 + turn on 837,627 through 978,723 + toggle 96,748 through 973,753 + toggle 99,818 through 609,995 + turn on 731,193 through 756,509 + turn off 622,55 through 813,365 + turn on 456,490 through 576,548 + turn on 48,421 through 163,674 + turn off 853,861 through 924,964 + turn off 59,963 through 556,987 + turn on 458,710 through 688,847 + toggle 12,484 through 878,562 + turn off 241,964 through 799,983 + turn off 434,299 through 845,772 + toggle 896,725 through 956,847 + turn on 740,289 through 784,345 + turn off 395,840 through 822,845 + turn on 955,224 through 996,953 + turn off 710,186 through 957,722 + turn off 485,949 through 869,985 + turn on 848,209 through 975,376 + toggle 221,241 through 906,384 + turn on 588,49 through 927,496 + turn on 273,332 through 735,725 + turn on 505,962 through 895,962 + toggle 820,112 through 923,143 + turn on 919,792 through 978,982 + toggle 489,461 through 910,737 + turn off 202,642 through 638,940 + turn off 708,953 through 970,960 + toggle 437,291 through 546,381 + turn on 409,358 through 837,479 + turn off 756,279 through 870,943 + turn off 154,657 through 375,703 + turn off 524,622 through 995,779 + toggle 514,221 through 651,850 + toggle 808,464 through 886,646 + toggle 483,537 through 739,840 + toggle 654,769 through 831,825 + turn off 326,37 through 631,69 + turn off 590,570 through 926,656 + turn off 881,913 through 911,998 + turn on 996,102 through 998,616 + turn off 677,503 through 828,563 + turn on 860,251 through 877,441 + turn off 964,100 through 982,377 + toggle 888,403 through 961,597 + turn off 632,240 through 938,968 + toggle 731,176 through 932,413 + turn on 5,498 through 203,835 + turn on 819,352 through 929,855 + toggle 393,813 through 832,816 + toggle 725,689 through 967,888 + turn on 968,950 through 969,983 + turn off 152,628 through 582,896 + turn off 165,844 through 459,935 + turn off 882,741 through 974,786 + turn off 283,179 through 731,899 + toggle 197,366 through 682,445 + turn on 106,309 through 120,813 + toggle 950,387 through 967,782 + turn off 274,603 through 383,759 + turn off 155,665 through 284,787 + toggle 551,871 through 860,962 + turn off 30,826 through 598,892 + toggle 76,552 through 977,888 + turn on 938,180 through 994,997 + toggle 62,381 through 993,656 + toggle 625,861 through 921,941 + turn on 685,311 through 872,521 + turn on 124,934 through 530,962 + turn on 606,379 through 961,867 + turn off 792,735 through 946,783 + turn on 417,480 through 860,598 + toggle 178,91 through 481,887 + turn off 23,935 through 833,962 + toggle 317,14 through 793,425 + turn on 986,89 through 999,613 + turn off 359,201 through 560,554 + turn off 729,494 through 942,626 + turn on 204,143 through 876,610 + toggle 474,97 through 636,542 + turn off 902,924 through 976,973 + turn off 389,442 through 824,638 + turn off 622,863 through 798,863 + turn on 840,622 through 978,920 + toggle 567,374 through 925,439 + turn off 643,319 through 935,662 + toggle 185,42 through 294,810 + turn on 47,124 through 598,880 + toggle 828,303 through 979,770 + turn off 174,272 through 280,311 + turn off 540,50 through 880,212 + turn on 141,994 through 221,998 + turn on 476,695 through 483,901 + turn on 960,216 through 972,502 + toggle 752,335 through 957,733 + turn off 419,713 through 537,998 + toggle 772,846 through 994,888 + turn on 881,159 through 902,312 + turn off 537,651 through 641,816 + toggle 561,947 through 638,965 + turn on 368,458 through 437,612 + turn on 290,149 through 705,919 + turn on 711,918 through 974,945 + toggle 916,242 through 926,786 + toggle 522,272 through 773,314 + turn on 432,897 through 440,954 + turn off 132,169 through 775,380 + toggle 52,205 through 693,747 + toggle 926,309 through 976,669 + turn off 838,342 through 938,444 + turn on 144,431 through 260,951 + toggle 780,318 through 975,495 + turn off 185,412 through 796,541 + turn on 879,548 through 892,860 + turn on 294,132 through 460,338 + turn on 823,500 through 899,529 + turn off 225,603 through 483,920 + toggle 717,493 through 930,875 + toggle 534,948 through 599,968 + turn on 522,730 through 968,950 + turn off 102,229 through 674,529 +#+END_EXAMPLE +:END: + +#+BEGIN_SRC emacs-lisp :var input=6-input :exports both + (defun day6/make-light () + nil) + + (defun day6/turn-on-light (light) + t) + + (defun day6/turn-off-light (light) + nil) + + (defun day6/toggle-light (light) + (not light)) + + (defun day6/lit? (light) + light) + + (defun day6/make-grid (size) + (let ((table (make-hash-table :size (* size size)))) + (-each (number-sequence 0 (- (* size size) 1)) + (lambda (pos) (puthash pos (day6/make-light) table))) + (cons size + table))) + + (defun day6/grid-size (grid) + (car grid)) + + (defun day6/grid-table (grid) + (cdr grid)) + + (defun day6/grid-lights (grid) + (hash-table-values (day6/grid-table grid))) + + (defun day6/grid-location (grid x y) + (+ x (* y (day6/grid-size grid)))) + + (ert-deftest day6/grid-location () + (should (eq 99 (let ((grid (day6/make-grid 100))) + (day6/grid-location grid 99 0)))) + (should (eq 100 (let ((grid (day6/make-grid 100))) + (day6/grid-location grid 0 1))))) + + (defun day6/grid-light (grid location) + (gethash location (day6/grid-table grid))) + + (defun day6/grid-do (grid fun location) + (puthash location + (funcall fun (day6/grid-light grid location)) + (day6/grid-table grid))) + + (defun day6/change-range (grid light-fun x1 y1 x2 y2) + (loop for x from x1 to x2 + do (loop for y from y1 to y2 + do (let* ((location (day6/grid-location grid x y))) + (day6/grid-do grid light-fun location))))) + + (defun day6/lit-count (grid) + (length (-filter #'day6/lit? (day6/grid-lights grid)))) + + (ert-deftest day6/lit-count () + (should (eq 1000000 + (let ((grid (day6/make-grid 1000))) + (day6/change-range grid #'day6/turn-on-light + 0 0 999 999) + (day6/lit-count grid)))) + (should (eq 4 + (let ((grid (day6/make-grid 1000))) + (day6/change-range grid #'day6/turn-on-light + 499 499 500 500) + (day6/lit-count grid))))) + + (defun day6/parse-instruction (instruction) + (if (string-match (concat "\\(turn \\(on\\|off\\)\\|toggle\\) " + "\\([0-9]+\\),\\([0-9]+\\)" + " through " + "\\([0-9]+\\),\\([0-9]+\\)") + instruction) + (list (cond ((string-equal "turn on" (match-string 1 instruction)) + #'day6/turn-on-light) + ((string-equal "turn off" (match-string 1 instruction)) + #'day6/turn-off-light) + ((string-equal "toggle" (match-string 1 instruction)) + #'day6/toggle-light)) + (string-to-int (match-string 3 instruction)) + (string-to-int (match-string 4 instruction)) + (string-to-int (match-string 5 instruction)) + (string-to-int (match-string 6 instruction))))) + + (ert-deftest day6/parse-instruction () + (should (equal '(day6/turn-on-light 887 9 959 629) + (day6/parse-instruction "turn on 887,9 through 959,629"))) + (should (equal '(day6/turn-off-light 539 243 559 965) + (day6/parse-instruction "turn off 539,243 through 559,965"))) + (should (equal '(day6/toggle-light 720 196 897 994) + (day6/parse-instruction "toggle 720,196 through 897,994")))) + + (defun day6/run-instruction (grid instruction) + (let ((parsed-instruction (day6/parse-instruction instruction))) + (eval (append '(day6/change-range grid) + (list (quote (first parsed-instruction))) + (rest parsed-instruction))))) + + (let ((grid (day6/make-grid 1000))) + (-map + (apply-partially 'day6/run-instruction grid) + (split-string input "\n"))) +#+END_SRC + +#+RESULTS[fbdd0a0f84a2f3df4d6c6c22cac0d787d85e08c7]: +| day6/change-range | grid | day6/turn-on-light | 887 | 9 | 959 | 629 | +| day6/change-range | grid | day6/turn-on-light | 454 | 398 | 844 | 448 | +| day6/change-range | grid | day6/turn-off-light | 539 | 243 | 559 | 965 | +| day6/change-range | grid | day6/turn-off-light | 370 | 819 | 676 | 868 | +| day6/change-range | grid | day6/turn-off-light | 145 | 40 | 370 | 997 | +| day6/change-range | grid | day6/turn-off-light | 301 | 3 | 808 | 453 | +| day6/change-range | grid | day6/turn-on-light | 351 | 678 | 951 | 908 | +| day6/change-range | grid | day6/toggle-light | 720 | 196 | 897 | 994 | +| day6/change-range | grid | day6/toggle-light | 831 | 394 | 904 | 860 | +| day6/change-range | grid | day6/toggle-light | 753 | 664 | 970 | 926 | +| day6/change-range | grid | day6/turn-off-light | 150 | 300 | 213 | 740 | +| day6/change-range | grid | day6/turn-on-light | 141 | 242 | 932 | 871 | +| day6/change-range | grid | day6/toggle-light | 294 | 259 | 474 | 326 | +| day6/change-range | grid | day6/toggle-light | 678 | 333 | 752 | 957 | +| day6/change-range | grid | day6/toggle-light | 393 | 804 | 510 | 976 | +| day6/change-range | grid | day6/turn-off-light | 6 | 964 | 411 | 976 | +| day6/change-range | grid | day6/turn-off-light | 33 | 572 | 978 | 590 | +| day6/change-range | grid | day6/turn-on-light | 579 | 693 | 650 | 978 | +| day6/change-range | grid | day6/turn-on-light | 150 | 20 | 652 | 719 | +| day6/change-range | grid | day6/turn-off-light | 782 | 143 | 808 | 802 | +| day6/change-range | grid | day6/turn-off-light | 240 | 377 | 761 | 468 | +| day6/change-range | grid | day6/turn-off-light | 899 | 828 | 958 | 967 | +| day6/change-range | grid | day6/turn-on-light | 613 | 565 | 952 | 659 | +| day6/change-range | grid | day6/turn-on-light | 295 | 36 | 964 | 978 | +| day6/change-range | grid | day6/toggle-light | 846 | 296 | 969 | 528 | +| day6/change-range | grid | day6/turn-off-light | 211 | 254 | 529 | 491 | +| day6/change-range | grid | day6/turn-off-light | 231 | 594 | 406 | 794 | +| day6/change-range | grid | day6/turn-off-light | 169 | 791 | 758 | 942 | +| day6/change-range | grid | day6/turn-on-light | 955 | 440 | 980 | 477 | +| day6/change-range | grid | day6/toggle-light | 944 | 498 | 995 | 928 | +| day6/change-range | grid | day6/turn-on-light | 519 | 391 | 605 | 718 | +| day6/change-range | grid | day6/toggle-light | 521 | 303 | 617 | 366 | +| day6/change-range | grid | day6/turn-off-light | 524 | 349 | 694 | 791 | +| day6/change-range | grid | day6/toggle-light | 391 | 87 | 499 | 792 | +| day6/change-range | grid | day6/toggle-light | 562 | 527 | 668 | 935 | +| day6/change-range | grid | day6/turn-off-light | 68 | 358 | 857 | 453 | +| day6/change-range | grid | day6/toggle-light | 815 | 811 | 889 | 828 | +| day6/change-range | grid | day6/turn-off-light | 666 | 61 | 768 | 87 | +| day6/change-range | grid | day6/turn-on-light | 27 | 501 | 921 | 952 | +| day6/change-range | grid | day6/turn-on-light | 953 | 102 | 983 | 471 | +| day6/change-range | grid | day6/turn-on-light | 277 | 552 | 451 | 723 | +| day6/change-range | grid | day6/turn-off-light | 64 | 253 | 655 | 960 | +| day6/change-range | grid | day6/turn-on-light | 47 | 485 | 734 | 977 | +| day6/change-range | grid | day6/turn-off-light | 59 | 119 | 699 | 734 | +| day6/change-range | grid | day6/toggle-light | 407 | 898 | 493 | 955 | +| day6/change-range | grid | day6/toggle-light | 912 | 966 | 949 | 991 | +| day6/change-range | grid | day6/turn-on-light | 479 | 990 | 895 | 990 | +| day6/change-range | grid | day6/toggle-light | 390 | 589 | 869 | 766 | +| day6/change-range | grid | day6/toggle-light | 593 | 903 | 926 | 943 | +| day6/change-range | grid | day6/toggle-light | 358 | 439 | 870 | 528 | +| day6/change-range | grid | day6/turn-off-light | 649 | 410 | 652 | 875 | +| day6/change-range | grid | day6/turn-on-light | 629 | 834 | 712 | 895 | +| day6/change-range | grid | day6/toggle-light | 254 | 555 | 770 | 901 | +| day6/change-range | grid | day6/toggle-light | 641 | 832 | 947 | 850 | +| day6/change-range | grid | day6/turn-on-light | 268 | 448 | 743 | 777 | +| day6/change-range | grid | day6/turn-off-light | 512 | 123 | 625 | 874 | +| day6/change-range | grid | day6/turn-off-light | 498 | 262 | 930 | 811 | +| day6/change-range | grid | day6/turn-off-light | 835 | 158 | 886 | 242 | +| day6/change-range | grid | day6/toggle-light | 546 | 310 | 607 | 773 | +| day6/change-range | grid | day6/turn-on-light | 501 | 505 | 896 | 909 | +| day6/change-range | grid | day6/turn-off-light | 666 | 796 | 817 | 924 | +| day6/change-range | grid | day6/toggle-light | 987 | 789 | 993 | 809 | +| day6/change-range | grid | day6/toggle-light | 745 | 8 | 860 | 693 | +| day6/change-range | grid | day6/toggle-light | 181 | 983 | 731 | 988 | +| day6/change-range | grid | day6/turn-on-light | 826 | 174 | 924 | 883 | +| day6/change-range | grid | day6/turn-on-light | 239 | 228 | 843 | 993 | +| day6/change-range | grid | day6/turn-on-light | 205 | 613 | 891 | 667 | +| day6/change-range | grid | day6/toggle-light | 867 | 873 | 984 | 896 | +| day6/change-range | grid | day6/turn-on-light | 628 | 251 | 677 | 681 | +| day6/change-range | grid | day6/toggle-light | 276 | 956 | 631 | 964 | +| day6/change-range | grid | day6/turn-on-light | 78 | 358 | 974 | 713 | +| day6/change-range | grid | day6/turn-on-light | 521 | 360 | 773 | 597 | +| day6/change-range | grid | day6/turn-off-light | 963 | 52 | 979 | 502 | +| day6/change-range | grid | day6/turn-on-light | 117 | 151 | 934 | 622 | +| day6/change-range | grid | day6/toggle-light | 237 | 91 | 528 | 164 | +| day6/change-range | grid | day6/turn-on-light | 944 | 269 | 975 | 453 | +| day6/change-range | grid | day6/toggle-light | 979 | 460 | 988 | 964 | +| day6/change-range | grid | day6/turn-off-light | 440 | 254 | 681 | 507 | +| day6/change-range | grid | day6/toggle-light | 347 | 100 | 896 | 785 | +| day6/change-range | grid | day6/turn-off-light | 329 | 592 | 369 | 985 | +| day6/change-range | grid | day6/turn-on-light | 931 | 960 | 979 | 985 | +| day6/change-range | grid | day6/toggle-light | 703 | 3 | 776 | 36 | +| day6/change-range | grid | day6/toggle-light | 798 | 120 | 908 | 550 | +| day6/change-range | grid | day6/turn-off-light | 186 | 605 | 914 | 709 | +| day6/change-range | grid | day6/turn-off-light | 921 | 725 | 979 | 956 | +| day6/change-range | grid | day6/toggle-light | 167 | 34 | 735 | 249 | +| day6/change-range | grid | day6/turn-on-light | 726 | 781 | 987 | 936 | +| day6/change-range | grid | day6/toggle-light | 720 | 336 | 847 | 756 | +| day6/change-range | grid | day6/turn-on-light | 171 | 630 | 656 | 769 | +| day6/change-range | grid | day6/turn-off-light | 417 | 276 | 751 | 500 | +| day6/change-range | grid | day6/toggle-light | 559 | 485 | 584 | 534 | +| day6/change-range | grid | day6/turn-on-light | 568 | 629 | 690 | 873 | +| day6/change-range | grid | day6/toggle-light | 248 | 712 | 277 | 988 | +| day6/change-range | grid | day6/toggle-light | 345 | 594 | 812 | 723 | +| day6/change-range | grid | day6/turn-off-light | 800 | 108 | 834 | 618 | +| day6/change-range | grid | day6/turn-off-light | 967 | 439 | 986 | 869 | +| day6/change-range | grid | day6/turn-on-light | 842 | 209 | 955 | 529 | +| day6/change-range | grid | day6/turn-on-light | 132 | 653 | 357 | 696 | +| day6/change-range | grid | day6/turn-on-light | 817 | 38 | 973 | 662 | +| day6/change-range | grid | day6/turn-off-light | 569 | 816 | 721 | 861 | +| day6/change-range | grid | day6/turn-on-light | 568 | 429 | 945 | 724 | +| day6/change-range | grid | day6/turn-on-light | 77 | 458 | 844 | 685 | +| day6/change-range | grid | day6/turn-off-light | 138 | 78 | 498 | 851 | +| day6/change-range | grid | day6/turn-on-light | 136 | 21 | 252 | 986 | +| day6/change-range | grid | day6/turn-off-light | 2 | 460 | 863 | 472 | +| day6/change-range | grid | day6/turn-on-light | 172 | 81 | 839 | 332 | +| day6/change-range | grid | day6/turn-on-light | 123 | 216 | 703 | 384 | +| day6/change-range | grid | day6/turn-off-light | 879 | 644 | 944 | 887 | +| day6/change-range | grid | day6/toggle-light | 227 | 491 | 504 | 793 | +| day6/change-range | grid | day6/toggle-light | 580 | 418 | 741 | 479 | +| day6/change-range | grid | day6/toggle-light | 65 | 276 | 414 | 299 | +| day6/change-range | grid | day6/toggle-light | 482 | 486 | 838 | 931 | +| day6/change-range | grid | day6/turn-off-light | 557 | 768 | 950 | 927 | +| day6/change-range | grid | day6/turn-off-light | 615 | 617 | 955 | 864 | +| day6/change-range | grid | day6/turn-on-light | 859 | 886 | 923 | 919 | +| day6/change-range | grid | day6/turn-on-light | 391 | 330 | 499 | 971 | +| day6/change-range | grid | day6/toggle-light | 521 | 835 | 613 | 847 | +| day6/change-range | grid | day6/turn-on-light | 822 | 787 | 989 | 847 | +| day6/change-range | grid | day6/turn-on-light | 192 | 142 | 357 | 846 | +| day6/change-range | grid | day6/turn-off-light | 564 | 945 | 985 | 945 | +| day6/change-range | grid | day6/turn-off-light | 479 | 361 | 703 | 799 | +| day6/change-range | grid | day6/toggle-light | 56 | 481 | 489 | 978 | +| day6/change-range | grid | day6/turn-off-light | 632 | 991 | 774 | 998 | +| day6/change-range | grid | day6/toggle-light | 723 | 526 | 945 | 792 | +| day6/change-range | grid | day6/turn-on-light | 344 | 149 | 441 | 640 | +| day6/change-range | grid | day6/toggle-light | 568 | 927 | 624 | 952 | +| day6/change-range | grid | day6/turn-on-light | 621 | 784 | 970 | 788 | +| day6/change-range | grid | day6/toggle-light | 665 | 783 | 795 | 981 | +| day6/change-range | grid | day6/toggle-light | 386 | 610 | 817 | 730 | +| day6/change-range | grid | day6/toggle-light | 440 | 399 | 734 | 417 | +| day6/change-range | grid | day6/toggle-light | 939 | 201 | 978 | 803 | +| day6/change-range | grid | day6/turn-off-light | 395 | 883 | 554 | 929 | +| day6/change-range | grid | day6/turn-on-light | 340 | 309 | 637 | 561 | +| day6/change-range | grid | day6/turn-off-light | 875 | 147 | 946 | 481 | +| day6/change-range | grid | day6/turn-off-light | 945 | 837 | 957 | 922 | +| day6/change-range | grid | day6/turn-off-light | 429 | 982 | 691 | 991 | +| day6/change-range | grid | day6/toggle-light | 227 | 137 | 439 | 822 | +| day6/change-range | grid | day6/toggle-light | 4 | 848 | 7 | 932 | +| day6/change-range | grid | day6/turn-off-light | 545 | 146 | 756 | 943 | +| day6/change-range | grid | day6/turn-on-light | 763 | 863 | 937 | 994 | +| day6/change-range | grid | day6/turn-on-light | 232 | 94 | 404 | 502 | +| day6/change-range | grid | day6/turn-off-light | 742 | 254 | 930 | 512 | +| day6/change-range | grid | day6/turn-on-light | 91 | 931 | 101 | 942 | +| day6/change-range | grid | day6/toggle-light | 585 | 106 | 651 | 425 | +| day6/change-range | grid | day6/turn-on-light | 506 | 700 | 567 | 960 | +| day6/change-range | grid | day6/turn-off-light | 548 | 44 | 718 | 352 | +| day6/change-range | grid | day6/turn-off-light | 194 | 827 | 673 | 859 | +| day6/change-range | grid | day6/turn-off-light | 6 | 645 | 509 | 764 | +| day6/change-range | grid | day6/turn-off-light | 13 | 230 | 821 | 361 | +| day6/change-range | grid | day6/turn-on-light | 734 | 629 | 919 | 631 | +| day6/change-range | grid | day6/toggle-light | 788 | 552 | 957 | 972 | +| day6/change-range | grid | day6/toggle-light | 244 | 747 | 849 | 773 | +| day6/change-range | grid | day6/turn-off-light | 162 | 553 | 276 | 887 | +| day6/change-range | grid | day6/turn-off-light | 569 | 577 | 587 | 604 | +| day6/change-range | grid | day6/turn-off-light | 799 | 482 | 854 | 956 | +| day6/change-range | grid | day6/turn-on-light | 744 | 535 | 909 | 802 | +| day6/change-range | grid | day6/toggle-light | 330 | 641 | 396 | 986 | +| day6/change-range | grid | day6/turn-off-light | 927 | 458 | 966 | 564 | +| day6/change-range | grid | day6/toggle-light | 984 | 486 | 986 | 913 | +| day6/change-range | grid | day6/toggle-light | 519 | 682 | 632 | 708 | +| day6/change-range | grid | day6/turn-on-light | 984 | 977 | 989 | 986 | +| day6/change-range | grid | day6/toggle-light | 766 | 423 | 934 | 495 | +| day6/change-range | grid | day6/turn-on-light | 17 | 509 | 947 | 718 | +| day6/change-range | grid | day6/turn-on-light | 413 | 783 | 631 | 903 | +| day6/change-range | grid | day6/turn-on-light | 482 | 370 | 493 | 688 | +| day6/change-range | grid | day6/turn-on-light | 433 | 859 | 628 | 938 | +| day6/change-range | grid | day6/turn-off-light | 769 | 549 | 945 | 810 | +| day6/change-range | grid | day6/turn-on-light | 178 | 853 | 539 | 941 | +| day6/change-range | grid | day6/turn-off-light | 203 | 251 | 692 | 433 | +| day6/change-range | grid | day6/turn-off-light | 525 | 638 | 955 | 794 | +| day6/change-range | grid | day6/turn-on-light | 169 | 70 | 764 | 939 | +| day6/change-range | grid | day6/toggle-light | 59 | 352 | 896 | 404 | +| day6/change-range | grid | day6/toggle-light | 143 | 245 | 707 | 320 | +| day6/change-range | grid | day6/turn-off-light | 103 | 35 | 160 | 949 | +| day6/change-range | grid | day6/toggle-light | 496 | 24 | 669 | 507 | +| day6/change-range | grid | day6/turn-off-light | 581 | 847 | 847 | 903 | +| day6/change-range | grid | day6/turn-on-light | 689 | 153 | 733 | 562 | +| day6/change-range | grid | day6/turn-on-light | 821 | 487 | 839 | 699 | +| day6/change-range | grid | day6/turn-on-light | 837 | 627 | 978 | 723 | +| day6/change-range | grid | day6/toggle-light | 96 | 748 | 973 | 753 | +| day6/change-range | grid | day6/toggle-light | 99 | 818 | 609 | 995 | +| day6/change-range | grid | day6/turn-on-light | 731 | 193 | 756 | 509 | +| day6/change-range | grid | day6/turn-off-light | 622 | 55 | 813 | 365 | +| day6/change-range | grid | day6/turn-on-light | 456 | 490 | 576 | 548 | +| day6/change-range | grid | day6/turn-on-light | 48 | 421 | 163 | 674 | +| day6/change-range | grid | day6/turn-off-light | 853 | 861 | 924 | 964 | +| day6/change-range | grid | day6/turn-off-light | 59 | 963 | 556 | 987 | +| day6/change-range | grid | day6/turn-on-light | 458 | 710 | 688 | 847 | +| day6/change-range | grid | day6/toggle-light | 12 | 484 | 878 | 562 | +| day6/change-range | grid | day6/turn-off-light | 241 | 964 | 799 | 983 | +| day6/change-range | grid | day6/turn-off-light | 434 | 299 | 845 | 772 | +| day6/change-range | grid | day6/toggle-light | 896 | 725 | 956 | 847 | +| day6/change-range | grid | day6/turn-on-light | 740 | 289 | 784 | 345 | +| day6/change-range | grid | day6/turn-off-light | 395 | 840 | 822 | 845 | +| day6/change-range | grid | day6/turn-on-light | 955 | 224 | 996 | 953 | +| day6/change-range | grid | day6/turn-off-light | 710 | 186 | 957 | 722 | +| day6/change-range | grid | day6/turn-off-light | 485 | 949 | 869 | 985 | +| day6/change-range | grid | day6/turn-on-light | 848 | 209 | 975 | 376 | +| day6/change-range | grid | day6/toggle-light | 221 | 241 | 906 | 384 | +| day6/change-range | grid | day6/turn-on-light | 588 | 49 | 927 | 496 | +| day6/change-range | grid | day6/turn-on-light | 273 | 332 | 735 | 725 | +| day6/change-range | grid | day6/turn-on-light | 505 | 962 | 895 | 962 | +| day6/change-range | grid | day6/toggle-light | 820 | 112 | 923 | 143 | +| day6/change-range | grid | day6/turn-on-light | 919 | 792 | 978 | 982 | +| day6/change-range | grid | day6/toggle-light | 489 | 461 | 910 | 737 | +| day6/change-range | grid | day6/turn-off-light | 202 | 642 | 638 | 940 | +| day6/change-range | grid | day6/turn-off-light | 708 | 953 | 970 | 960 | +| day6/change-range | grid | day6/toggle-light | 437 | 291 | 546 | 381 | +| day6/change-range | grid | day6/turn-on-light | 409 | 358 | 837 | 479 | +| day6/change-range | grid | day6/turn-off-light | 756 | 279 | 870 | 943 | +| day6/change-range | grid | day6/turn-off-light | 154 | 657 | 375 | 703 | +| day6/change-range | grid | day6/turn-off-light | 524 | 622 | 995 | 779 | +| day6/change-range | grid | day6/toggle-light | 514 | 221 | 651 | 850 | +| day6/change-range | grid | day6/toggle-light | 808 | 464 | 886 | 646 | +| day6/change-range | grid | day6/toggle-light | 483 | 537 | 739 | 840 | +| day6/change-range | grid | day6/toggle-light | 654 | 769 | 831 | 825 | +| day6/change-range | grid | day6/turn-off-light | 326 | 37 | 631 | 69 | +| day6/change-range | grid | day6/turn-off-light | 590 | 570 | 926 | 656 | +| day6/change-range | grid | day6/turn-off-light | 881 | 913 | 911 | 998 | +| day6/change-range | grid | day6/turn-on-light | 996 | 102 | 998 | 616 | +| day6/change-range | grid | day6/turn-off-light | 677 | 503 | 828 | 563 | +| day6/change-range | grid | day6/turn-on-light | 860 | 251 | 877 | 441 | +| day6/change-range | grid | day6/turn-off-light | 964 | 100 | 982 | 377 | +| day6/change-range | grid | day6/toggle-light | 888 | 403 | 961 | 597 | +| day6/change-range | grid | day6/turn-off-light | 632 | 240 | 938 | 968 | +| day6/change-range | grid | day6/toggle-light | 731 | 176 | 932 | 413 | +| day6/change-range | grid | day6/turn-on-light | 5 | 498 | 203 | 835 | +| day6/change-range | grid | day6/turn-on-light | 819 | 352 | 929 | 855 | +| day6/change-range | grid | day6/toggle-light | 393 | 813 | 832 | 816 | +| day6/change-range | grid | day6/toggle-light | 725 | 689 | 967 | 888 | +| day6/change-range | grid | day6/turn-on-light | 968 | 950 | 969 | 983 | +| day6/change-range | grid | day6/turn-off-light | 152 | 628 | 582 | 896 | +| day6/change-range | grid | day6/turn-off-light | 165 | 844 | 459 | 935 | +| day6/change-range | grid | day6/turn-off-light | 882 | 741 | 974 | 786 | +| day6/change-range | grid | day6/turn-off-light | 283 | 179 | 731 | 899 | +| day6/change-range | grid | day6/toggle-light | 197 | 366 | 682 | 445 | +| day6/change-range | grid | day6/turn-on-light | 106 | 309 | 120 | 813 | +| day6/change-range | grid | day6/toggle-light | 950 | 387 | 967 | 782 | +| day6/change-range | grid | day6/turn-off-light | 274 | 603 | 383 | 759 | +| day6/change-range | grid | day6/turn-off-light | 155 | 665 | 284 | 787 | +| day6/change-range | grid | day6/toggle-light | 551 | 871 | 860 | 962 | +| day6/change-range | grid | day6/turn-off-light | 30 | 826 | 598 | 892 | +| day6/change-range | grid | day6/toggle-light | 76 | 552 | 977 | 888 | +| day6/change-range | grid | day6/turn-on-light | 938 | 180 | 994 | 997 | +| day6/change-range | grid | day6/toggle-light | 62 | 381 | 993 | 656 | +| day6/change-range | grid | day6/toggle-light | 625 | 861 | 921 | 941 | +| day6/change-range | grid | day6/turn-on-light | 685 | 311 | 872 | 521 | +| day6/change-range | grid | day6/turn-on-light | 124 | 934 | 530 | 962 | +| day6/change-range | grid | day6/turn-on-light | 606 | 379 | 961 | 867 | +| day6/change-range | grid | day6/turn-off-light | 792 | 735 | 946 | 783 | +| day6/change-range | grid | day6/turn-on-light | 417 | 480 | 860 | 598 | +| day6/change-range | grid | day6/toggle-light | 178 | 91 | 481 | 887 | +| day6/change-range | grid | day6/turn-off-light | 23 | 935 | 833 | 962 | +| day6/change-range | grid | day6/toggle-light | 317 | 14 | 793 | 425 | +| day6/change-range | grid | day6/turn-on-light | 986 | 89 | 999 | 613 | +| day6/change-range | grid | day6/turn-off-light | 359 | 201 | 560 | 554 | +| day6/change-range | grid | day6/turn-off-light | 729 | 494 | 942 | 626 | +| day6/change-range | grid | day6/turn-on-light | 204 | 143 | 876 | 610 | +| day6/change-range | grid | day6/toggle-light | 474 | 97 | 636 | 542 | +| day6/change-range | grid | day6/turn-off-light | 902 | 924 | 976 | 973 | +| day6/change-range | grid | day6/turn-off-light | 389 | 442 | 824 | 638 | +| day6/change-range | grid | day6/turn-off-light | 622 | 863 | 798 | 863 | +| day6/change-range | grid | day6/turn-on-light | 840 | 622 | 978 | 920 | +| day6/change-range | grid | day6/toggle-light | 567 | 374 | 925 | 439 | +| day6/change-range | grid | day6/turn-off-light | 643 | 319 | 935 | 662 | +| day6/change-range | grid | day6/toggle-light | 185 | 42 | 294 | 810 | +| day6/change-range | grid | day6/turn-on-light | 47 | 124 | 598 | 880 | +| day6/change-range | grid | day6/toggle-light | 828 | 303 | 979 | 770 | +| day6/change-range | grid | day6/turn-off-light | 174 | 272 | 280 | 311 | +| day6/change-range | grid | day6/turn-off-light | 540 | 50 | 880 | 212 | +| day6/change-range | grid | day6/turn-on-light | 141 | 994 | 221 | 998 | +| day6/change-range | grid | day6/turn-on-light | 476 | 695 | 483 | 901 | +| day6/change-range | grid | day6/turn-on-light | 960 | 216 | 972 | 502 | +| day6/change-range | grid | day6/toggle-light | 752 | 335 | 957 | 733 | +| day6/change-range | grid | day6/turn-off-light | 419 | 713 | 537 | 998 | +| day6/change-range | grid | day6/toggle-light | 772 | 846 | 994 | 888 | +| day6/change-range | grid | day6/turn-on-light | 881 | 159 | 902 | 312 | +| day6/change-range | grid | day6/turn-off-light | 537 | 651 | 641 | 816 | +| day6/change-range | grid | day6/toggle-light | 561 | 947 | 638 | 965 | +| day6/change-range | grid | day6/turn-on-light | 368 | 458 | 437 | 612 | +| day6/change-range | grid | day6/turn-on-light | 290 | 149 | 705 | 919 | +| day6/change-range | grid | day6/turn-on-light | 711 | 918 | 974 | 945 | +| day6/change-range | grid | day6/toggle-light | 916 | 242 | 926 | 786 | +| day6/change-range | grid | day6/toggle-light | 522 | 272 | 773 | 314 | +| day6/change-range | grid | day6/turn-on-light | 432 | 897 | 440 | 954 | +| day6/change-range | grid | day6/turn-off-light | 132 | 169 | 775 | 380 | +| day6/change-range | grid | day6/toggle-light | 52 | 205 | 693 | 747 | +| day6/change-range | grid | day6/toggle-light | 926 | 309 | 976 | 669 | +| day6/change-range | grid | day6/turn-off-light | 838 | 342 | 938 | 444 | +| day6/change-range | grid | day6/turn-on-light | 144 | 431 | 260 | 951 | +| day6/change-range | grid | day6/toggle-light | 780 | 318 | 975 | 495 | +| day6/change-range | grid | day6/turn-off-light | 185 | 412 | 796 | 541 | +| day6/change-range | grid | day6/turn-on-light | 879 | 548 | 892 | 860 | +| day6/change-range | grid | day6/turn-on-light | 294 | 132 | 460 | 338 | +| day6/change-range | grid | day6/turn-on-light | 823 | 500 | 899 | 529 | +| day6/change-range | grid | day6/turn-off-light | 225 | 603 | 483 | 920 | +| day6/change-range | grid | day6/toggle-light | 717 | 493 | 930 | 875 | +| day6/change-range | grid | day6/toggle-light | 534 | 948 | 599 | 968 | +| day6/change-range | grid | day6/turn-on-light | 522 | 730 | 968 | 950 | +| day6/change-range | grid | day6/turn-off-light | 102 | 229 | 674 | 529 | +| day6/change-range | grid | | | | | | +