Compare commits
85 Commits
master
...
master-bla
@ -0,0 +1,21 @@
|
|||||||
|
# for Racket
|
||||||
|
compiled/
|
||||||
|
*~
|
||||||
|
|
||||||
|
# for Mac OS X
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
Icon
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear on external disk
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
|
||||||
|
# generated documentation
|
||||||
|
*.js
|
||||||
|
*.css
|
||||||
|
*.html
|
@ -1,2 +1,9 @@
|
|||||||
# aoc-racket
|
Racket solutions & explanations for the [Advent of Code](http://adventofcode.com) puzzles. Written in Racket's literate-programming dialect, `scribble/lp2`.
|
||||||
Racket solutions & explanations for the Advent of Code puzzles
|
|
||||||
|
Install from the command line:
|
||||||
|
|
||||||
|
raco pkg install aoc-racket
|
||||||
|
|
||||||
|
Explanations will be installed automatically as part of the Scribble documentation.
|
||||||
|
|
||||||
|
[Or just read the code and explanations online, right now.](http://pkg-build.racket-lang.org/doc/aoc-racket/)
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
#lang scribble/manual
|
||||||
|
@(require (for-label racket rackunit sugar/list))
|
||||||
|
|
||||||
|
@title{Advent of Code: solutions & explanations}
|
||||||
|
|
||||||
|
@author[(author+email "Matthew Butterick" "mb@mbtype.com")]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket]
|
||||||
|
|
||||||
|
@italic{Dedicated to curious characters everywhere, especially those learning Racket.}
|
||||||
|
|
||||||
|
@link["http://adventofcode.com"]{Advent of Code} is a series of programming puzzles designed by @link["http://was.tl"]{Eric Wastl}.
|
||||||
|
|
||||||
|
I find that programming puzzles are a good way of learning something new about a programming language, or learning how to do certain things better. Documenting these solutions helped me nail down some discoveries.
|
||||||
|
|
||||||
|
Thank you to Eric Wastl. If you like Advent of Code, please @link["http://adventofcode.com/about"]{pay him for it}.
|
||||||
|
|
||||||
|
You can install this package (if you haven't already) with
|
||||||
|
|
||||||
|
@tt{raco pkg install aoc-racket}
|
||||||
|
|
||||||
|
@local-table-of-contents[]
|
||||||
|
|
||||||
|
@include-section[(submod "day01.rkt" doc)]
|
||||||
|
@include-section[(submod "day02.rkt" doc)]
|
||||||
|
@include-section[(submod "day03.rkt" doc)]
|
||||||
|
@include-section[(submod "day04.rkt" doc)]
|
||||||
|
@include-section[(submod "day05.rkt" doc)]
|
||||||
|
@include-section[(submod "day06.rkt" doc)]
|
||||||
|
@include-section[(submod "day07.rkt" doc)]
|
||||||
|
@include-section[(submod "day08.rkt" doc)]
|
||||||
|
@include-section[(submod "day09.rkt" doc)]
|
||||||
|
@include-section[(submod "day10.rkt" doc)]
|
||||||
|
@include-section[(submod "day11.rkt" doc)]
|
||||||
|
@include-section[(submod "day12.rkt" doc)]
|
||||||
|
@include-section[(submod "day13.rkt" doc)]
|
||||||
|
@include-section[(submod "day14.rkt" doc)]
|
||||||
|
@include-section[(submod "day15.rkt" doc)]
|
||||||
|
@include-section[(submod "day16.rkt" doc)]
|
||||||
|
@include-section[(submod "day17.rkt" doc)]
|
||||||
|
@include-section[(submod "day18.rkt" doc)]
|
||||||
|
@include-section[(submod "day19.rkt" doc)]
|
||||||
|
@include-section[(submod "day20.rkt" doc)]
|
||||||
|
@include-section[(submod "day21.rkt" doc)]
|
||||||
|
@include-section[(submod "day22.rkt" doc)]
|
||||||
|
@include-section[(submod "day23.rkt" doc)]
|
||||||
|
@include-section[(submod "day24.rkt" doc)]
|
||||||
|
@include-section[(submod "day25.rkt" doc)]
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,68 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
|
||||||
|
@aoc-title[2]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket/day02]
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/2"]{The puzzle}. Our @link-rp["day02-input.txt"]{input} is a list of strings that represent dimensions of rectangular boxes.
|
||||||
|
|
||||||
|
@chunk[<day02>
|
||||||
|
<day02-setup>
|
||||||
|
<day02-q1>
|
||||||
|
<day02-test>]
|
||||||
|
|
||||||
|
|
||||||
|
@section{How much paper is needed to wrap the boxes?}
|
||||||
|
|
||||||
|
According to the problem, the paper needed to wrap a present is the surface area of the box (= the sum of the areas of the sides) plus the area of the smallest side.
|
||||||
|
|
||||||
|
First we need to parse our input file into a list of box dimensions. We'll model each box as a list of three dimensions. (The question doesn't need us to keep height / width / depth straight, so we won't worry about it.)
|
||||||
|
|
||||||
|
Then we have a traditional setup for the devastating one-two punch of @racket[map] and @racket[apply]. We'll write a function to compute surface area from box dimensions. Then we'll @racket[map] that function across the list of boxes, and finally @racket[apply] the @racket[+] operator to our list of results to get the answer.
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day02-setup>
|
||||||
|
(require racket rackunit)
|
||||||
|
(provide (all-defined-out))
|
||||||
|
(define (string->boxes str)
|
||||||
|
(for/list ([ln (in-list (string-split str "\n"))])
|
||||||
|
(map string->number (string-split ln "x"))))]
|
||||||
|
|
||||||
|
@chunk[<day02-q1>
|
||||||
|
(define (box->paper box)
|
||||||
|
(match-define (list x y z) box)
|
||||||
|
(define sides (list (* x y) (* y z) (* x z)))
|
||||||
|
(+ (* 2 (apply + sides)) (apply min sides)))
|
||||||
|
|
||||||
|
(define (q1 str)
|
||||||
|
(define boxes (string->boxes str))
|
||||||
|
(apply + (map box->paper boxes)))]
|
||||||
|
|
||||||
|
@section{How much ribbon is needed to wrap the boxes?}
|
||||||
|
|
||||||
|
According to the problem, the ribbon needed is the perimeter of the smallest side plus the volume of the box.
|
||||||
|
|
||||||
|
We take the same approach, with a new @racket[box->ribbon] function.
|
||||||
|
|
||||||
|
@chunk[<day02-q1>
|
||||||
|
(define (box->ribbon box)
|
||||||
|
(match-define (list x y z) box)
|
||||||
|
(define (perimeter dim1 dim2) (* 2 (+ dim1 dim2)))
|
||||||
|
(define perimeters
|
||||||
|
(list (perimeter x y) (perimeter y z) (perimeter x z)))
|
||||||
|
(+ (apply min perimeters) (* x y z)))
|
||||||
|
|
||||||
|
(define (q2 str)
|
||||||
|
(define boxes (string->boxes str))
|
||||||
|
(apply + (map box->ribbon boxes)))]
|
||||||
|
|
||||||
|
|
||||||
|
@section{Testing Day 2}
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day02-test>
|
||||||
|
(module+ test
|
||||||
|
(define input-str (file->string "day02-input.txt"))
|
||||||
|
(check-equal? (q1 input-str) 1586300)
|
||||||
|
(check-equal? (q2 input-str) 3737498))]
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
iwrupvqb
|
@ -0,0 +1,54 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
@(require (for-label openssl/md5))
|
||||||
|
|
||||||
|
@aoc-title[4]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket/day04]
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/4"]{The puzzle}. Our @link-rp["day04-input.txt"]{input} is a string of eight characters that represents part of a key for making an MD5 hash.
|
||||||
|
|
||||||
|
@chunk[<day04>
|
||||||
|
<day04-setup>
|
||||||
|
<day04-q1>
|
||||||
|
<day04-q2>
|
||||||
|
<day04-test>]
|
||||||
|
|
||||||
|
@section{What is the lowest-numbered MD5 hash starting with five zeroes?}
|
||||||
|
|
||||||
|
We're asked to create an MD5 hash from an input key that consists of our eight-character input joined to a decimal number. The puzzle asks us to find the lowest decimal number that, when joined to our input, produces an MD5 hash that starts with five zeroes.
|
||||||
|
|
||||||
|
Whether or not you already know what an MD5 hash is, you can search the Racket docs and will soon find the @racketmodname[openssl/md5] module and the @racket[md5] function. Then, this puzzle is easy: starting at @racket[0], make new input keys with each integer, and stop when we find one that results in the MD5 hash we want. (The approach is similar to the second part of @secref{Day_1}.)
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day04-setup>
|
||||||
|
(require racket rackunit openssl/md5)
|
||||||
|
(provide (all-defined-out))
|
||||||
|
]
|
||||||
|
|
||||||
|
@chunk[<day04-q1>
|
||||||
|
(define (q1 str)
|
||||||
|
(for/or ([i (in-naturals)])
|
||||||
|
(define md5-key (string-append str (~a i)))
|
||||||
|
(define md5-hash (md5 (open-input-string md5-key)))
|
||||||
|
(and (string-prefix? md5-hash "00000") i)))
|
||||||
|
]
|
||||||
|
|
||||||
|
@section{How about six zeroes?}
|
||||||
|
|
||||||
|
Exactly the same, except we test for a string of six zeroes. It is likely, however, to take quite a bit longer to run, as the sixth zero essentially makes the criterion 10 times more stringent.
|
||||||
|
|
||||||
|
@chunk[<day04-q2>
|
||||||
|
(define (q2 str)
|
||||||
|
(for/or ([i (in-naturals)])
|
||||||
|
(define md5-key (string-append str (~a i)))
|
||||||
|
(define md5-hash (md5 (open-input-string md5-key)))
|
||||||
|
(and (string-prefix? md5-hash "000000") i)))]
|
||||||
|
|
||||||
|
@section{Testing Day 4}
|
||||||
|
|
||||||
|
@chunk[<day04-test>
|
||||||
|
(module+ test
|
||||||
|
(define input-str (file->string "day04-input.txt"))
|
||||||
|
(check-equal? (q1 input-str) 346386)
|
||||||
|
(check-equal? (q2 input-str) 9958218))]
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,80 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
|
||||||
|
@aoc-title[5]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket/day05]
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/5"]{The puzzle}. Our @link-rp["day05-input.txt"]{input} is a list of random-looking but not really random text strings.
|
||||||
|
|
||||||
|
@chunk[<day05>
|
||||||
|
<day05-setup>
|
||||||
|
<day05-q1>
|
||||||
|
<day05-q2>
|
||||||
|
<day05-test>]
|
||||||
|
|
||||||
|
@section{How many strings are ``nice''?}
|
||||||
|
|
||||||
|
A string is ``nice'' if it meets certain criteria:
|
||||||
|
|
||||||
|
@itemlist[
|
||||||
|
@item{Contains three vowels (= @litchar{aeiou}).}
|
||||||
|
@item{Contains a double letter.}
|
||||||
|
@item{Does not contain @litchar{ab}, @litchar{cd}, @litchar{pq}, or @litchar{xy}.}
|
||||||
|
]
|
||||||
|
|
||||||
|
This is a job for @racket[regexp-match]. There's nothing tricky here (except for remembering that certain matching functions require the @racket[pregexp] pattern prefix rather than @racket[regexp]).
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day05-setup>
|
||||||
|
(require racket rackunit)
|
||||||
|
(provide (all-defined-out))
|
||||||
|
]
|
||||||
|
|
||||||
|
@chunk[<day05-q1>
|
||||||
|
(define (nice? str)
|
||||||
|
(define (three-vowels? str)
|
||||||
|
(>= (length (regexp-match* #rx"[aeiou]" str)) 3))
|
||||||
|
(define (double-letter? str)
|
||||||
|
(regexp-match #px"(.)\\1" str))
|
||||||
|
(define (no-kapu? str)
|
||||||
|
(not (regexp-match #rx"ab|cd|pq|xy" str)))
|
||||||
|
(and (three-vowels? str)
|
||||||
|
(double-letter? str)
|
||||||
|
(no-kapu? str)))
|
||||||
|
|
||||||
|
(define (q1 words)
|
||||||
|
(length (filter nice? words)))
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
@section{How many strings are ``nice'' under new rules?}
|
||||||
|
|
||||||
|
This time a string is ``nice`` if it:
|
||||||
|
|
||||||
|
@itemlist[
|
||||||
|
@item{Contains a pair of two letters that appears twice without overlapping}
|
||||||
|
@item{Contains a letter that repeats with at least one letter in between}
|
||||||
|
]
|
||||||
|
|
||||||
|
Again, a test of your regexp-writing skills.
|
||||||
|
|
||||||
|
@chunk[<day05-q2>
|
||||||
|
(define (nicer? str)
|
||||||
|
(define (nonoverlapping-pair? str)
|
||||||
|
(regexp-match #px"(..).*\\1" str))
|
||||||
|
(define (separated-repeater? str)
|
||||||
|
(regexp-match #px"(.).\\1" str))
|
||||||
|
(and (nonoverlapping-pair? str)
|
||||||
|
(separated-repeater? str) #t))
|
||||||
|
|
||||||
|
(define (q2 words)
|
||||||
|
(length (filter nicer? words)))]
|
||||||
|
|
||||||
|
@section{Testing Day 5}
|
||||||
|
|
||||||
|
@chunk[<day05-test>
|
||||||
|
(module+ test
|
||||||
|
(define input-str (file->lines "day05-input.txt"))
|
||||||
|
(check-equal? (q1 input-str) 238)
|
||||||
|
(check-equal? (q2 input-str) 69))]
|
@ -0,0 +1,300 @@
|
|||||||
|
turn off 660,55 through 986,197
|
||||||
|
turn off 341,304 through 638,850
|
||||||
|
turn off 199,133 through 461,193
|
||||||
|
toggle 322,558 through 977,958
|
||||||
|
toggle 537,781 through 687,941
|
||||||
|
turn on 226,196 through 599,390
|
||||||
|
turn on 240,129 through 703,297
|
||||||
|
turn on 317,329 through 451,798
|
||||||
|
turn on 957,736 through 977,890
|
||||||
|
turn on 263,530 through 559,664
|
||||||
|
turn on 158,270 through 243,802
|
||||||
|
toggle 223,39 through 454,511
|
||||||
|
toggle 544,218 through 979,872
|
||||||
|
turn on 313,306 through 363,621
|
||||||
|
toggle 173,401 through 496,407
|
||||||
|
toggle 333,60 through 748,159
|
||||||
|
turn off 87,577 through 484,608
|
||||||
|
turn on 809,648 through 826,999
|
||||||
|
toggle 352,432 through 628,550
|
||||||
|
turn off 197,408 through 579,569
|
||||||
|
turn off 1,629 through 802,633
|
||||||
|
turn off 61,44 through 567,111
|
||||||
|
toggle 880,25 through 903,973
|
||||||
|
turn on 347,123 through 864,746
|
||||||
|
toggle 728,877 through 996,975
|
||||||
|
turn on 121,895 through 349,906
|
||||||
|
turn on 888,547 through 931,628
|
||||||
|
toggle 398,782 through 834,882
|
||||||
|
turn on 966,850 through 989,953
|
||||||
|
turn off 891,543 through 914,991
|
||||||
|
toggle 908,77 through 916,117
|
||||||
|
turn on 576,900 through 943,934
|
||||||
|
turn off 580,170 through 963,206
|
||||||
|
turn on 184,638 through 192,944
|
||||||
|
toggle 940,147 through 978,730
|
||||||
|
turn off 854,56 through 965,591
|
||||||
|
toggle 717,172 through 947,995
|
||||||
|
toggle 426,987 through 705,998
|
||||||
|
turn on 987,157 through 992,278
|
||||||
|
toggle 995,774 through 997,784
|
||||||
|
turn off 796,96 through 845,182
|
||||||
|
turn off 451,87 through 711,655
|
||||||
|
turn off 380,93 through 968,676
|
||||||
|
turn on 263,468 through 343,534
|
||||||
|
turn on 917,936 through 928,959
|
||||||
|
toggle 478,7 through 573,148
|
||||||
|
turn off 428,339 through 603,624
|
||||||
|
turn off 400,880 through 914,953
|
||||||
|
toggle 679,428 through 752,779
|
||||||
|
turn off 697,981 through 709,986
|
||||||
|
toggle 482,566 through 505,725
|
||||||
|
turn off 956,368 through 993,516
|
||||||
|
toggle 735,823 through 783,883
|
||||||
|
turn off 48,487 through 892,496
|
||||||
|
turn off 116,680 through 564,819
|
||||||
|
turn on 633,865 through 729,930
|
||||||
|
turn off 314,618 through 571,922
|
||||||
|
toggle 138,166 through 936,266
|
||||||
|
turn on 444,732 through 664,960
|
||||||
|
turn off 109,337 through 972,497
|
||||||
|
turn off 51,432 through 77,996
|
||||||
|
turn off 259,297 through 366,744
|
||||||
|
toggle 801,130 through 917,544
|
||||||
|
toggle 767,982 through 847,996
|
||||||
|
turn on 216,507 through 863,885
|
||||||
|
turn off 61,441 through 465,731
|
||||||
|
turn on 849,970 through 944,987
|
||||||
|
toggle 845,76 through 852,951
|
||||||
|
toggle 732,615 through 851,936
|
||||||
|
toggle 251,128 through 454,778
|
||||||
|
turn on 324,429 through 352,539
|
||||||
|
toggle 52,450 through 932,863
|
||||||
|
turn off 449,379 through 789,490
|
||||||
|
turn on 317,319 through 936,449
|
||||||
|
toggle 887,670 through 957,838
|
||||||
|
toggle 671,613 through 856,664
|
||||||
|
turn off 186,648 through 985,991
|
||||||
|
turn off 471,689 through 731,717
|
||||||
|
toggle 91,331 through 750,758
|
||||||
|
toggle 201,73 through 956,524
|
||||||
|
toggle 82,614 through 520,686
|
||||||
|
toggle 84,287 through 467,734
|
||||||
|
turn off 132,367 through 208,838
|
||||||
|
toggle 558,684 through 663,920
|
||||||
|
turn on 237,952 through 265,997
|
||||||
|
turn on 694,713 through 714,754
|
||||||
|
turn on 632,523 through 862,827
|
||||||
|
turn on 918,780 through 948,916
|
||||||
|
turn on 349,586 through 663,976
|
||||||
|
toggle 231,29 through 257,589
|
||||||
|
toggle 886,428 through 902,993
|
||||||
|
turn on 106,353 through 236,374
|
||||||
|
turn on 734,577 through 759,684
|
||||||
|
turn off 347,843 through 696,912
|
||||||
|
turn on 286,699 through 964,883
|
||||||
|
turn on 605,875 through 960,987
|
||||||
|
turn off 328,286 through 869,461
|
||||||
|
turn off 472,569 through 980,848
|
||||||
|
toggle 673,573 through 702,884
|
||||||
|
turn off 398,284 through 738,332
|
||||||
|
turn on 158,50 through 284,411
|
||||||
|
turn off 390,284 through 585,663
|
||||||
|
turn on 156,579 through 646,581
|
||||||
|
turn on 875,493 through 989,980
|
||||||
|
toggle 486,391 through 924,539
|
||||||
|
turn on 236,722 through 272,964
|
||||||
|
toggle 228,282 through 470,581
|
||||||
|
toggle 584,389 through 750,761
|
||||||
|
turn off 899,516 through 900,925
|
||||||
|
turn on 105,229 through 822,846
|
||||||
|
turn off 253,77 through 371,877
|
||||||
|
turn on 826,987 through 906,992
|
||||||
|
turn off 13,152 through 615,931
|
||||||
|
turn on 835,320 through 942,399
|
||||||
|
turn on 463,504 through 536,720
|
||||||
|
toggle 746,942 through 786,998
|
||||||
|
turn off 867,333 through 965,403
|
||||||
|
turn on 591,477 through 743,692
|
||||||
|
turn off 403,437 through 508,908
|
||||||
|
turn on 26,723 through 368,814
|
||||||
|
turn on 409,485 through 799,809
|
||||||
|
turn on 115,630 through 704,705
|
||||||
|
turn off 228,183 through 317,220
|
||||||
|
toggle 300,649 through 382,842
|
||||||
|
turn off 495,365 through 745,562
|
||||||
|
turn on 698,346 through 744,873
|
||||||
|
turn on 822,932 through 951,934
|
||||||
|
toggle 805,30 through 925,421
|
||||||
|
toggle 441,152 through 653,274
|
||||||
|
toggle 160,81 through 257,587
|
||||||
|
turn off 350,781 through 532,917
|
||||||
|
toggle 40,583 through 348,636
|
||||||
|
turn on 280,306 through 483,395
|
||||||
|
toggle 392,936 through 880,955
|
||||||
|
toggle 496,591 through 851,934
|
||||||
|
turn off 780,887 through 946,994
|
||||||
|
turn off 205,735 through 281,863
|
||||||
|
toggle 100,876 through 937,915
|
||||||
|
turn on 392,393 through 702,878
|
||||||
|
turn on 956,374 through 976,636
|
||||||
|
toggle 478,262 through 894,775
|
||||||
|
turn off 279,65 through 451,677
|
||||||
|
turn on 397,541 through 809,847
|
||||||
|
turn on 444,291 through 451,586
|
||||||
|
toggle 721,408 through 861,598
|
||||||
|
turn on 275,365 through 609,382
|
||||||
|
turn on 736,24 through 839,72
|
||||||
|
turn off 86,492 through 582,712
|
||||||
|
turn on 676,676 through 709,703
|
||||||
|
turn off 105,710 through 374,817
|
||||||
|
toggle 328,748 through 845,757
|
||||||
|
toggle 335,79 through 394,326
|
||||||
|
toggle 193,157 through 633,885
|
||||||
|
turn on 227,48 through 769,743
|
||||||
|
toggle 148,333 through 614,568
|
||||||
|
toggle 22,30 through 436,263
|
||||||
|
toggle 547,447 through 688,969
|
||||||
|
toggle 576,621 through 987,740
|
||||||
|
turn on 711,334 through 799,515
|
||||||
|
turn on 541,448 through 654,951
|
||||||
|
toggle 792,199 through 798,990
|
||||||
|
turn on 89,956 through 609,960
|
||||||
|
toggle 724,433 through 929,630
|
||||||
|
toggle 144,895 through 201,916
|
||||||
|
toggle 226,730 through 632,871
|
||||||
|
turn off 760,819 through 828,974
|
||||||
|
toggle 887,180 through 940,310
|
||||||
|
toggle 222,327 through 805,590
|
||||||
|
turn off 630,824 through 885,963
|
||||||
|
turn on 940,740 through 954,946
|
||||||
|
turn on 193,373 through 779,515
|
||||||
|
toggle 304,955 through 469,975
|
||||||
|
turn off 405,480 through 546,960
|
||||||
|
turn on 662,123 through 690,669
|
||||||
|
turn off 615,238 through 750,714
|
||||||
|
turn on 423,220 through 930,353
|
||||||
|
turn on 329,769 through 358,970
|
||||||
|
toggle 590,151 through 704,722
|
||||||
|
turn off 884,539 through 894,671
|
||||||
|
toggle 449,241 through 984,549
|
||||||
|
toggle 449,260 through 496,464
|
||||||
|
turn off 306,448 through 602,924
|
||||||
|
turn on 286,805 through 555,901
|
||||||
|
toggle 722,177 through 922,298
|
||||||
|
toggle 491,554 through 723,753
|
||||||
|
turn on 80,849 through 174,996
|
||||||
|
turn off 296,561 through 530,856
|
||||||
|
toggle 653,10 through 972,284
|
||||||
|
toggle 529,236 through 672,614
|
||||||
|
toggle 791,598 through 989,695
|
||||||
|
turn on 19,45 through 575,757
|
||||||
|
toggle 111,55 through 880,871
|
||||||
|
turn off 197,897 through 943,982
|
||||||
|
turn on 912,336 through 977,605
|
||||||
|
toggle 101,221 through 537,450
|
||||||
|
turn on 101,104 through 969,447
|
||||||
|
toggle 71,527 through 587,717
|
||||||
|
toggle 336,445 through 593,889
|
||||||
|
toggle 214,179 through 575,699
|
||||||
|
turn on 86,313 through 96,674
|
||||||
|
toggle 566,427 through 906,888
|
||||||
|
turn off 641,597 through 850,845
|
||||||
|
turn on 606,524 through 883,704
|
||||||
|
turn on 835,775 through 867,887
|
||||||
|
toggle 547,301 through 897,515
|
||||||
|
toggle 289,930 through 413,979
|
||||||
|
turn on 361,122 through 457,226
|
||||||
|
turn on 162,187 through 374,746
|
||||||
|
turn on 348,461 through 454,675
|
||||||
|
turn off 966,532 through 985,537
|
||||||
|
turn on 172,354 through 630,606
|
||||||
|
turn off 501,880 through 680,993
|
||||||
|
turn off 8,70 through 566,592
|
||||||
|
toggle 433,73 through 690,651
|
||||||
|
toggle 840,798 through 902,971
|
||||||
|
toggle 822,204 through 893,760
|
||||||
|
turn off 453,496 through 649,795
|
||||||
|
turn off 969,549 through 990,942
|
||||||
|
turn off 789,28 through 930,267
|
||||||
|
toggle 880,98 through 932,434
|
||||||
|
toggle 568,674 through 669,753
|
||||||
|
turn on 686,228 through 903,271
|
||||||
|
turn on 263,995 through 478,999
|
||||||
|
toggle 534,675 through 687,955
|
||||||
|
turn off 342,434 through 592,986
|
||||||
|
toggle 404,768 through 677,867
|
||||||
|
toggle 126,723 through 978,987
|
||||||
|
toggle 749,675 through 978,959
|
||||||
|
turn off 445,330 through 446,885
|
||||||
|
turn off 463,205 through 924,815
|
||||||
|
turn off 417,430 through 915,472
|
||||||
|
turn on 544,990 through 912,999
|
||||||
|
turn off 201,255 through 834,789
|
||||||
|
turn off 261,142 through 537,862
|
||||||
|
turn off 562,934 through 832,984
|
||||||
|
turn off 459,978 through 691,980
|
||||||
|
turn off 73,911 through 971,972
|
||||||
|
turn on 560,448 through 723,810
|
||||||
|
turn on 204,630 through 217,854
|
||||||
|
turn off 91,259 through 611,607
|
||||||
|
turn on 877,32 through 978,815
|
||||||
|
turn off 950,438 through 974,746
|
||||||
|
toggle 426,30 through 609,917
|
||||||
|
toggle 696,37 through 859,201
|
||||||
|
toggle 242,417 through 682,572
|
||||||
|
turn off 388,401 through 979,528
|
||||||
|
turn off 79,345 through 848,685
|
||||||
|
turn off 98,91 through 800,434
|
||||||
|
toggle 650,700 through 972,843
|
||||||
|
turn off 530,450 through 538,926
|
||||||
|
turn on 428,559 through 962,909
|
||||||
|
turn on 78,138 through 92,940
|
||||||
|
toggle 194,117 through 867,157
|
||||||
|
toggle 785,355 through 860,617
|
||||||
|
turn off 379,441 through 935,708
|
||||||
|
turn off 605,133 through 644,911
|
||||||
|
toggle 10,963 through 484,975
|
||||||
|
turn off 359,988 through 525,991
|
||||||
|
turn off 509,138 through 787,411
|
||||||
|
toggle 556,467 through 562,773
|
||||||
|
turn on 119,486 through 246,900
|
||||||
|
turn on 445,561 through 794,673
|
||||||
|
turn off 598,681 through 978,921
|
||||||
|
turn off 974,230 through 995,641
|
||||||
|
turn off 760,75 through 800,275
|
||||||
|
toggle 441,215 through 528,680
|
||||||
|
turn off 701,636 through 928,877
|
||||||
|
turn on 165,753 through 202,780
|
||||||
|
toggle 501,412 through 998,516
|
||||||
|
toggle 161,105 through 657,395
|
||||||
|
turn on 113,340 through 472,972
|
||||||
|
toggle 384,994 through 663,999
|
||||||
|
turn on 969,994 through 983,997
|
||||||
|
turn on 519,600 through 750,615
|
||||||
|
turn off 363,899 through 948,935
|
||||||
|
turn on 271,845 through 454,882
|
||||||
|
turn off 376,528 through 779,640
|
||||||
|
toggle 767,98 through 854,853
|
||||||
|
toggle 107,322 through 378,688
|
||||||
|
turn off 235,899 through 818,932
|
||||||
|
turn on 445,611 through 532,705
|
||||||
|
toggle 629,387 through 814,577
|
||||||
|
toggle 112,414 through 387,421
|
||||||
|
toggle 319,184 through 382,203
|
||||||
|
turn on 627,796 through 973,940
|
||||||
|
toggle 602,45 through 763,151
|
||||||
|
turn off 441,375 through 974,545
|
||||||
|
toggle 871,952 through 989,998
|
||||||
|
turn on 717,272 through 850,817
|
||||||
|
toggle 475,711 through 921,882
|
||||||
|
toggle 66,191 through 757,481
|
||||||
|
turn off 50,197 through 733,656
|
||||||
|
toggle 83,575 through 915,728
|
||||||
|
turn on 777,812 through 837,912
|
||||||
|
turn on 20,984 through 571,994
|
||||||
|
turn off 446,432 through 458,648
|
||||||
|
turn on 715,871 through 722,890
|
||||||
|
toggle 424,675 through 740,862
|
||||||
|
toggle 580,592 through 671,900
|
||||||
|
toggle 296,687 through 906,775
|
@ -0,0 +1,339 @@
|
|||||||
|
bn RSHIFT 2 -> bo
|
||||||
|
lf RSHIFT 1 -> ly
|
||||||
|
fo RSHIFT 3 -> fq
|
||||||
|
cj OR cp -> cq
|
||||||
|
fo OR fz -> ga
|
||||||
|
t OR s -> u
|
||||||
|
lx -> a
|
||||||
|
NOT ax -> ay
|
||||||
|
he RSHIFT 2 -> hf
|
||||||
|
lf OR lq -> lr
|
||||||
|
lr AND lt -> lu
|
||||||
|
dy OR ej -> ek
|
||||||
|
1 AND cx -> cy
|
||||||
|
hb LSHIFT 1 -> hv
|
||||||
|
1 AND bh -> bi
|
||||||
|
ih AND ij -> ik
|
||||||
|
c LSHIFT 1 -> t
|
||||||
|
ea AND eb -> ed
|
||||||
|
km OR kn -> ko
|
||||||
|
NOT bw -> bx
|
||||||
|
ci OR ct -> cu
|
||||||
|
NOT p -> q
|
||||||
|
lw OR lv -> lx
|
||||||
|
NOT lo -> lp
|
||||||
|
fp OR fv -> fw
|
||||||
|
o AND q -> r
|
||||||
|
dh AND dj -> dk
|
||||||
|
ap LSHIFT 1 -> bj
|
||||||
|
bk LSHIFT 1 -> ce
|
||||||
|
NOT ii -> ij
|
||||||
|
gh OR gi -> gj
|
||||||
|
kk RSHIFT 1 -> ld
|
||||||
|
lc LSHIFT 1 -> lw
|
||||||
|
lb OR la -> lc
|
||||||
|
1 AND am -> an
|
||||||
|
gn AND gp -> gq
|
||||||
|
lf RSHIFT 3 -> lh
|
||||||
|
e OR f -> g
|
||||||
|
lg AND lm -> lo
|
||||||
|
ci RSHIFT 1 -> db
|
||||||
|
cf LSHIFT 1 -> cz
|
||||||
|
bn RSHIFT 1 -> cg
|
||||||
|
et AND fe -> fg
|
||||||
|
is OR it -> iu
|
||||||
|
kw AND ky -> kz
|
||||||
|
ck AND cl -> cn
|
||||||
|
bj OR bi -> bk
|
||||||
|
gj RSHIFT 1 -> hc
|
||||||
|
iu AND jf -> jh
|
||||||
|
NOT bs -> bt
|
||||||
|
kk OR kv -> kw
|
||||||
|
ks AND ku -> kv
|
||||||
|
hz OR ik -> il
|
||||||
|
b RSHIFT 1 -> v
|
||||||
|
iu RSHIFT 1 -> jn
|
||||||
|
fo RSHIFT 5 -> fr
|
||||||
|
be AND bg -> bh
|
||||||
|
ga AND gc -> gd
|
||||||
|
hf OR hl -> hm
|
||||||
|
ld OR le -> lf
|
||||||
|
as RSHIFT 5 -> av
|
||||||
|
fm OR fn -> fo
|
||||||
|
hm AND ho -> hp
|
||||||
|
lg OR lm -> ln
|
||||||
|
NOT kx -> ky
|
||||||
|
kk RSHIFT 3 -> km
|
||||||
|
ek AND em -> en
|
||||||
|
NOT ft -> fu
|
||||||
|
NOT jh -> ji
|
||||||
|
jn OR jo -> jp
|
||||||
|
gj AND gu -> gw
|
||||||
|
d AND j -> l
|
||||||
|
et RSHIFT 1 -> fm
|
||||||
|
jq OR jw -> jx
|
||||||
|
ep OR eo -> eq
|
||||||
|
lv LSHIFT 15 -> lz
|
||||||
|
NOT ey -> ez
|
||||||
|
jp RSHIFT 2 -> jq
|
||||||
|
eg AND ei -> ej
|
||||||
|
NOT dm -> dn
|
||||||
|
jp AND ka -> kc
|
||||||
|
as AND bd -> bf
|
||||||
|
fk OR fj -> fl
|
||||||
|
dw OR dx -> dy
|
||||||
|
lj AND ll -> lm
|
||||||
|
ec AND ee -> ef
|
||||||
|
fq AND fr -> ft
|
||||||
|
NOT kp -> kq
|
||||||
|
ki OR kj -> kk
|
||||||
|
cz OR cy -> da
|
||||||
|
as RSHIFT 3 -> au
|
||||||
|
an LSHIFT 15 -> ar
|
||||||
|
fj LSHIFT 15 -> fn
|
||||||
|
1 AND fi -> fj
|
||||||
|
he RSHIFT 1 -> hx
|
||||||
|
lf RSHIFT 2 -> lg
|
||||||
|
kf LSHIFT 15 -> kj
|
||||||
|
dz AND ef -> eh
|
||||||
|
ib OR ic -> id
|
||||||
|
lf RSHIFT 5 -> li
|
||||||
|
bp OR bq -> br
|
||||||
|
NOT gs -> gt
|
||||||
|
fo RSHIFT 1 -> gh
|
||||||
|
bz AND cb -> cc
|
||||||
|
ea OR eb -> ec
|
||||||
|
lf AND lq -> ls
|
||||||
|
NOT l -> m
|
||||||
|
hz RSHIFT 3 -> ib
|
||||||
|
NOT di -> dj
|
||||||
|
NOT lk -> ll
|
||||||
|
jp RSHIFT 3 -> jr
|
||||||
|
jp RSHIFT 5 -> js
|
||||||
|
NOT bf -> bg
|
||||||
|
s LSHIFT 15 -> w
|
||||||
|
eq LSHIFT 1 -> fk
|
||||||
|
jl OR jk -> jm
|
||||||
|
hz AND ik -> im
|
||||||
|
dz OR ef -> eg
|
||||||
|
1 AND gy -> gz
|
||||||
|
la LSHIFT 15 -> le
|
||||||
|
br AND bt -> bu
|
||||||
|
NOT cn -> co
|
||||||
|
v OR w -> x
|
||||||
|
d OR j -> k
|
||||||
|
1 AND gd -> ge
|
||||||
|
ia OR ig -> ih
|
||||||
|
NOT go -> gp
|
||||||
|
NOT ed -> ee
|
||||||
|
jq AND jw -> jy
|
||||||
|
et OR fe -> ff
|
||||||
|
aw AND ay -> az
|
||||||
|
ff AND fh -> fi
|
||||||
|
ir LSHIFT 1 -> jl
|
||||||
|
gg LSHIFT 1 -> ha
|
||||||
|
x RSHIFT 2 -> y
|
||||||
|
db OR dc -> dd
|
||||||
|
bl OR bm -> bn
|
||||||
|
ib AND ic -> ie
|
||||||
|
x RSHIFT 3 -> z
|
||||||
|
lh AND li -> lk
|
||||||
|
ce OR cd -> cf
|
||||||
|
NOT bb -> bc
|
||||||
|
hi AND hk -> hl
|
||||||
|
NOT gb -> gc
|
||||||
|
1 AND r -> s
|
||||||
|
fw AND fy -> fz
|
||||||
|
fb AND fd -> fe
|
||||||
|
1 AND en -> eo
|
||||||
|
z OR aa -> ab
|
||||||
|
bi LSHIFT 15 -> bm
|
||||||
|
hg OR hh -> hi
|
||||||
|
kh LSHIFT 1 -> lb
|
||||||
|
cg OR ch -> ci
|
||||||
|
1 AND kz -> la
|
||||||
|
gf OR ge -> gg
|
||||||
|
gj RSHIFT 2 -> gk
|
||||||
|
dd RSHIFT 2 -> de
|
||||||
|
NOT ls -> lt
|
||||||
|
lh OR li -> lj
|
||||||
|
jr OR js -> jt
|
||||||
|
au AND av -> ax
|
||||||
|
0 -> c
|
||||||
|
he AND hp -> hr
|
||||||
|
id AND if -> ig
|
||||||
|
et RSHIFT 5 -> ew
|
||||||
|
bp AND bq -> bs
|
||||||
|
e AND f -> h
|
||||||
|
ly OR lz -> ma
|
||||||
|
1 AND lu -> lv
|
||||||
|
NOT jd -> je
|
||||||
|
ha OR gz -> hb
|
||||||
|
dy RSHIFT 1 -> er
|
||||||
|
iu RSHIFT 2 -> iv
|
||||||
|
NOT hr -> hs
|
||||||
|
as RSHIFT 1 -> bl
|
||||||
|
kk RSHIFT 2 -> kl
|
||||||
|
b AND n -> p
|
||||||
|
ln AND lp -> lq
|
||||||
|
cj AND cp -> cr
|
||||||
|
dl AND dn -> do
|
||||||
|
ci RSHIFT 2 -> cj
|
||||||
|
as OR bd -> be
|
||||||
|
ge LSHIFT 15 -> gi
|
||||||
|
hz RSHIFT 5 -> ic
|
||||||
|
dv LSHIFT 1 -> ep
|
||||||
|
kl OR kr -> ks
|
||||||
|
gj OR gu -> gv
|
||||||
|
he RSHIFT 5 -> hh
|
||||||
|
NOT fg -> fh
|
||||||
|
hg AND hh -> hj
|
||||||
|
b OR n -> o
|
||||||
|
jk LSHIFT 15 -> jo
|
||||||
|
gz LSHIFT 15 -> hd
|
||||||
|
cy LSHIFT 15 -> dc
|
||||||
|
kk RSHIFT 5 -> kn
|
||||||
|
ci RSHIFT 3 -> ck
|
||||||
|
at OR az -> ba
|
||||||
|
iu RSHIFT 3 -> iw
|
||||||
|
ko AND kq -> kr
|
||||||
|
NOT eh -> ei
|
||||||
|
aq OR ar -> as
|
||||||
|
iy AND ja -> jb
|
||||||
|
dd RSHIFT 3 -> df
|
||||||
|
bn RSHIFT 3 -> bp
|
||||||
|
1 AND cc -> cd
|
||||||
|
at AND az -> bb
|
||||||
|
x OR ai -> aj
|
||||||
|
kk AND kv -> kx
|
||||||
|
ao OR an -> ap
|
||||||
|
dy RSHIFT 3 -> ea
|
||||||
|
x RSHIFT 1 -> aq
|
||||||
|
eu AND fa -> fc
|
||||||
|
kl AND kr -> kt
|
||||||
|
ia AND ig -> ii
|
||||||
|
df AND dg -> di
|
||||||
|
NOT fx -> fy
|
||||||
|
k AND m -> n
|
||||||
|
bn RSHIFT 5 -> bq
|
||||||
|
km AND kn -> kp
|
||||||
|
dt LSHIFT 15 -> dx
|
||||||
|
hz RSHIFT 2 -> ia
|
||||||
|
aj AND al -> am
|
||||||
|
cd LSHIFT 15 -> ch
|
||||||
|
hc OR hd -> he
|
||||||
|
he RSHIFT 3 -> hg
|
||||||
|
bn OR by -> bz
|
||||||
|
NOT kt -> ku
|
||||||
|
z AND aa -> ac
|
||||||
|
NOT ak -> al
|
||||||
|
cu AND cw -> cx
|
||||||
|
NOT ie -> if
|
||||||
|
dy RSHIFT 2 -> dz
|
||||||
|
ip LSHIFT 15 -> it
|
||||||
|
de OR dk -> dl
|
||||||
|
au OR av -> aw
|
||||||
|
jg AND ji -> jj
|
||||||
|
ci AND ct -> cv
|
||||||
|
dy RSHIFT 5 -> eb
|
||||||
|
hx OR hy -> hz
|
||||||
|
eu OR fa -> fb
|
||||||
|
gj RSHIFT 3 -> gl
|
||||||
|
fo AND fz -> gb
|
||||||
|
1 AND jj -> jk
|
||||||
|
jp OR ka -> kb
|
||||||
|
de AND dk -> dm
|
||||||
|
ex AND ez -> fa
|
||||||
|
df OR dg -> dh
|
||||||
|
iv OR jb -> jc
|
||||||
|
x RSHIFT 5 -> aa
|
||||||
|
NOT hj -> hk
|
||||||
|
NOT im -> in
|
||||||
|
fl LSHIFT 1 -> gf
|
||||||
|
hu LSHIFT 15 -> hy
|
||||||
|
iq OR ip -> ir
|
||||||
|
iu RSHIFT 5 -> ix
|
||||||
|
NOT fc -> fd
|
||||||
|
NOT el -> em
|
||||||
|
ck OR cl -> cm
|
||||||
|
et RSHIFT 3 -> ev
|
||||||
|
hw LSHIFT 1 -> iq
|
||||||
|
ci RSHIFT 5 -> cl
|
||||||
|
iv AND jb -> jd
|
||||||
|
dd RSHIFT 5 -> dg
|
||||||
|
as RSHIFT 2 -> at
|
||||||
|
NOT jy -> jz
|
||||||
|
af AND ah -> ai
|
||||||
|
1 AND ds -> dt
|
||||||
|
jx AND jz -> ka
|
||||||
|
da LSHIFT 1 -> du
|
||||||
|
fs AND fu -> fv
|
||||||
|
jp RSHIFT 1 -> ki
|
||||||
|
iw AND ix -> iz
|
||||||
|
iw OR ix -> iy
|
||||||
|
eo LSHIFT 15 -> es
|
||||||
|
ev AND ew -> ey
|
||||||
|
ba AND bc -> bd
|
||||||
|
fp AND fv -> fx
|
||||||
|
jc AND je -> jf
|
||||||
|
et RSHIFT 2 -> eu
|
||||||
|
kg OR kf -> kh
|
||||||
|
iu OR jf -> jg
|
||||||
|
er OR es -> et
|
||||||
|
fo RSHIFT 2 -> fp
|
||||||
|
NOT ca -> cb
|
||||||
|
bv AND bx -> by
|
||||||
|
u LSHIFT 1 -> ao
|
||||||
|
cm AND co -> cp
|
||||||
|
y OR ae -> af
|
||||||
|
bn AND by -> ca
|
||||||
|
1 AND ke -> kf
|
||||||
|
jt AND jv -> jw
|
||||||
|
fq OR fr -> fs
|
||||||
|
dy AND ej -> el
|
||||||
|
NOT kc -> kd
|
||||||
|
ev OR ew -> ex
|
||||||
|
dd OR do -> dp
|
||||||
|
NOT cv -> cw
|
||||||
|
gr AND gt -> gu
|
||||||
|
dd RSHIFT 1 -> dw
|
||||||
|
NOT gw -> gx
|
||||||
|
NOT iz -> ja
|
||||||
|
1 AND io -> ip
|
||||||
|
NOT ag -> ah
|
||||||
|
b RSHIFT 5 -> f
|
||||||
|
NOT cr -> cs
|
||||||
|
kb AND kd -> ke
|
||||||
|
jr AND js -> ju
|
||||||
|
cq AND cs -> ct
|
||||||
|
il AND in -> io
|
||||||
|
NOT ju -> jv
|
||||||
|
du OR dt -> dv
|
||||||
|
dd AND do -> dq
|
||||||
|
b RSHIFT 2 -> d
|
||||||
|
jm LSHIFT 1 -> kg
|
||||||
|
NOT dq -> dr
|
||||||
|
bo OR bu -> bv
|
||||||
|
gk OR gq -> gr
|
||||||
|
he OR hp -> hq
|
||||||
|
NOT h -> i
|
||||||
|
hf AND hl -> hn
|
||||||
|
gv AND gx -> gy
|
||||||
|
x AND ai -> ak
|
||||||
|
bo AND bu -> bw
|
||||||
|
hq AND hs -> ht
|
||||||
|
hz RSHIFT 1 -> is
|
||||||
|
gj RSHIFT 5 -> gm
|
||||||
|
g AND i -> j
|
||||||
|
gk AND gq -> gs
|
||||||
|
dp AND dr -> ds
|
||||||
|
b RSHIFT 3 -> e
|
||||||
|
gl AND gm -> go
|
||||||
|
gl OR gm -> gn
|
||||||
|
y AND ae -> ag
|
||||||
|
hv OR hu -> hw
|
||||||
|
1674 -> b
|
||||||
|
ab AND ad -> ae
|
||||||
|
NOT ac -> ad
|
||||||
|
1 AND ht -> hu
|
||||||
|
NOT hn -> ho
|
@ -0,0 +1,300 @@
|
|||||||
|
"sjdivfriyaaqa\xd2v\"k\"mpcu\"yyu\"en"
|
||||||
|
"vcqc"
|
||||||
|
"zbcwgmbpijcxu\"yins\"sfxn"
|
||||||
|
"yumngprx"
|
||||||
|
"bbdj"
|
||||||
|
"czbggabkzo\"wsnw\"voklp\"s"
|
||||||
|
"acwt"
|
||||||
|
"aqttwnsohbzian\"evtllfxwkog\"cunzw"
|
||||||
|
"ugvsgfv"
|
||||||
|
"xlnillibxg"
|
||||||
|
"kexh\"pmi"
|
||||||
|
"syvugow"
|
||||||
|
"m\"ktqnw"
|
||||||
|
"yrbajyndte\\rm"
|
||||||
|
"f\"kak\x70sn\xc4kjri"
|
||||||
|
"yxthr"
|
||||||
|
"alvumfsjni\"kohg"
|
||||||
|
"trajs\x5brom\xf1yoijaumkem\"\"tahlzs"
|
||||||
|
"\"oedr\"pwdbnnrc"
|
||||||
|
"qsmzhnx\""
|
||||||
|
"\"msoytqimx\\tbklqz"
|
||||||
|
"mjdfcgwdshrehgs"
|
||||||
|
"\"rivyxahf\""
|
||||||
|
"ciagc\x04bp"
|
||||||
|
"xkfc"
|
||||||
|
"xrgcripdu\x4c\xc4gszjhrvumvz\"mngbirb"
|
||||||
|
"gvmae\"yiiujoqvr\"mkxmgbbut\"u"
|
||||||
|
"ih"
|
||||||
|
"ncrqlejehs"
|
||||||
|
"mkno\x43pcfdukmemycp"
|
||||||
|
"uanzoqxkpsksbvdnkji\"feamp"
|
||||||
|
"axoufpnbx\\ao\x61pfj\"b"
|
||||||
|
"dz\\ztawzdjy"
|
||||||
|
"ihne\"enumvswypgf"
|
||||||
|
"\"dgazthrphbshdo\\vuqoiy\""
|
||||||
|
"dlnmptzt\\zahwpylc\\b\"gmslrqysk"
|
||||||
|
"mhxznyzcp"
|
||||||
|
"rebr\"amvxw\x5fmbnfpkkeghlntavj"
|
||||||
|
"lades\x47ncgdof\"\"jmbbk"
|
||||||
|
"dwxuis\xa5wdkx\\z\"admgnoddpgkt\\zs"
|
||||||
|
"g\\k\x27qsl\x34hwfglcdxqbeclt\xca\\"
|
||||||
|
"lhyjky\\m\"pvnm\\xmynpxnlhndmahjl"
|
||||||
|
"c\"uxabbgorrpprw\"xas\\vefkxioqpt"
|
||||||
|
"rfrvjxpevcmma\x71gtfipo"
|
||||||
|
"fgh\"kcwoqwfnjgdlzfclprg\"q"
|
||||||
|
"onxnwykrba"
|
||||||
|
"hkkg\x60f\"tjzsanpvarzgkfipl"
|
||||||
|
"\"aintes\"ofq\"juiaqlqxmvpe\\a"
|
||||||
|
"wiyczzs\"ciwk"
|
||||||
|
"mfqeu"
|
||||||
|
"v\xe1z\x7ftzalmvdmncfivrax\\rjwq"
|
||||||
|
"k\"vtg"
|
||||||
|
"exhrtdugeml\xf0"
|
||||||
|
"behnchkpld"
|
||||||
|
"mhgxy\"mfcrg\xc5gnp\"\"osqhj"
|
||||||
|
"rlvjy"
|
||||||
|
"awe"
|
||||||
|
"ctwy"
|
||||||
|
"vt"
|
||||||
|
"\x54t"
|
||||||
|
"zugfmmfomz"
|
||||||
|
"cv\"cvcvfaada\x04fsuqjinbfh\xa9cq\xd2c\"d"
|
||||||
|
"oj"
|
||||||
|
"xazanf\"wbmcrn"
|
||||||
|
"\\\\zkisyjpbzandqikqjqvee"
|
||||||
|
"dpsnbzdwnxk\\v"
|
||||||
|
"sj\"tuupr\\oyoh"
|
||||||
|
"myvkgnw\x81q\xaaokt\\emgejbsyvxcl\\\xee"
|
||||||
|
"ejeuqvunjcirdkkpt\"nlns"
|
||||||
|
"twmlvwxyvfyqqzu"
|
||||||
|
"\"xwtzdp\x98qkcis\"dm\\\"ep\"xyykq"
|
||||||
|
"vvcq\\expok"
|
||||||
|
"wgukjfanjgpdjb"
|
||||||
|
"\"mjcjajnxy\\dcpc"
|
||||||
|
"wdvgnecw\\ab\x44klceduzgsvu"
|
||||||
|
"dqtqkukr\"iacngufbqkdpxlwjjt"
|
||||||
|
"\"xj\"\x66qofsqzkoah"
|
||||||
|
"nptiwwsqdep"
|
||||||
|
"gsnlxql\x30mjl"
|
||||||
|
"yeezwokjwrhelny\""
|
||||||
|
"bjauamn\\izpmzqqasid"
|
||||||
|
"tvjdbkn\"tiziw\x82r"
|
||||||
|
"w"
|
||||||
|
"xwoakbbnjnypnaa\xa9wft\"slrmoqkl"
|
||||||
|
"vwxtnlvaaasyruykgygrvpiopzygf\"vq"
|
||||||
|
"qdancvnvmhlmpj\\isdxs"
|
||||||
|
"xzc\\elw"
|
||||||
|
"b\"wxeqvy\"qf\"g\xcaoklsucwicyw\"dovr"
|
||||||
|
"yomlvvjdbngz\"rly\"afr"
|
||||||
|
"bfb\"x\"aweuwbwmoa\x13\"t\"zhr"
|
||||||
|
"\"dmfoxb\"qvpjzzhykt\xd2\"\"ryhxi"
|
||||||
|
"psqef\"yu\\qiflie\"\x79w"
|
||||||
|
"arzewkej\"lqmh\\sayyusxxo\\"
|
||||||
|
"vuvvp"
|
||||||
|
"hc\"lg\x6bcpupsewzklai\"l"
|
||||||
|
"cjdfygc\"auorqybnuqghsh\x10"
|
||||||
|
"j"
|
||||||
|
"wqjexk\"eyq\\lbroqhk\\dqzsqk"
|
||||||
|
"dws\"ru\"dvxfiwapif\"oqwzmle"
|
||||||
|
"agcykg\\jt\\vzklqjvknoe"
|
||||||
|
"kksd\"jmslja\\z\"y\\b\xaagpyojct"
|
||||||
|
"nnpipxufvbfpoz\"jno"
|
||||||
|
"dtw"
|
||||||
|
"xlolvtahvgqkx\\dgnhj\\spsclpcxv\\"
|
||||||
|
"mxea\\mbjpi"
|
||||||
|
"lgbotkk\"zmxh\\\\qji\"jszulnjsxkqf"
|
||||||
|
"lwckmhwhx\"gmftlb\x91am"
|
||||||
|
"xxdxqyxth"
|
||||||
|
"\"lmqhwkjxmvayxy"
|
||||||
|
"tf"
|
||||||
|
"qy"
|
||||||
|
"wdqmwxdztax\"m\"\x09\x11xdxmfwxmtqgwvf"
|
||||||
|
"\xcbnazlf\"ghziknszmsrahaf"
|
||||||
|
"e\x6aupmzhxlvwympgjjpdvo\"kylfa"
|
||||||
|
"\x81vhtlillb\xactgoatva"
|
||||||
|
"dvnlgr"
|
||||||
|
"f"
|
||||||
|
"xg\xfacwizsadgeclm"
|
||||||
|
"vnnrzbtw\"\\prod\\djbyppngwayy\""
|
||||||
|
"lrt\xf4jahwvfz"
|
||||||
|
"aqpnjtom\"ymkak\\dadfybqrso\\fwv"
|
||||||
|
"gz\"aac\"mrbk\"ktommrojraqh"
|
||||||
|
"wycamwoecsftepfnlcdkm"
|
||||||
|
"nrhddblbuzlqsl\x9cben"
|
||||||
|
"vckxhyqkmqmdseazcykrbysm"
|
||||||
|
"sil\xbbtevmt\"gvrvybui\"faw\"j"
|
||||||
|
"cjex\\tp\x45pzf"
|
||||||
|
"asjobvtxszfodgf\"ibftg"
|
||||||
|
"gkyjyjdrxdcllnh\"sjcibenrdnxv"
|
||||||
|
"oswsdpjyxpbwnqbcpl\"yrdvs\\zq"
|
||||||
|
"\"\"tyowzc\\fycbp\"jbwrbvgui"
|
||||||
|
"cbpcabqkdgzmpgcwjtrchxp"
|
||||||
|
"iyrzfh\x45gw\"fdlfpiaap\x31xqq"
|
||||||
|
"evgksznidz"
|
||||||
|
"b\\w\\"
|
||||||
|
"loufizbiy\x57aim\"bgk"
|
||||||
|
"qjfyk"
|
||||||
|
"g\"anmloghvgr\x07zwqougqhdz"
|
||||||
|
"usbbmwcxd\\bdgg"
|
||||||
|
"htitqcpczml"
|
||||||
|
"eke\\cqvpexqqk\"to\"tqmljrpn\xe6lji\""
|
||||||
|
"g\xd2ifdsej"
|
||||||
|
"h\"sk\"haajajpagtcqnzrfqn\xe6btzo"
|
||||||
|
"wfkuffdxlvm\\cvlyzlbyunclhmpp"
|
||||||
|
"myaavh\"spue"
|
||||||
|
"hqvez\x68d\"eo\"eaioh"
|
||||||
|
"s\"qd\"oyxxcglcdnuhk"
|
||||||
|
"ilqvar"
|
||||||
|
"srh"
|
||||||
|
"puuifxrfmpc\"bvalwi\x2blu\\"
|
||||||
|
"yywlbutufzysbncw\\nqsfbhpz\"mngjq"
|
||||||
|
"zbl\\jfcuop"
|
||||||
|
"hjdouiragzvxsqkreup\\"
|
||||||
|
"qi"
|
||||||
|
"ckx\\funlj\xa7ahi"
|
||||||
|
"k"
|
||||||
|
"ufrcnh\"ajteit"
|
||||||
|
"cqv\"bgjozjj\x60x\xa8yhvmdvutchjotyuz"
|
||||||
|
"hkuiet\"oku\x8cfhumfpasl"
|
||||||
|
"\"\\sbe\x4d"
|
||||||
|
"vhknazqt"
|
||||||
|
"eyyizvzcahgflvmoowvs\\jhvygci"
|
||||||
|
"kki\x3ewcefkgtjap\"xtpxh\"lzepoqj"
|
||||||
|
"wvtk"
|
||||||
|
"\"ynet"
|
||||||
|
"zh\\obk\"otagx\x59txfzf"
|
||||||
|
"ocowhxlx\xe6zqg\x63wx\\tclkhq\\vmaze"
|
||||||
|
"w\"cf"
|
||||||
|
"qpniprnrzrnvykghqnalr"
|
||||||
|
"jctcqra\"\x05dhlydpqamorqjsijt\\xjdgt"
|
||||||
|
"sig"
|
||||||
|
"qhlbidbflwxe\"xljbwls\x20vht"
|
||||||
|
"irmrebfla\xefsg\"j"
|
||||||
|
"nep"
|
||||||
|
"hjuvsqlizeqobepf"
|
||||||
|
"guzbcdp\"obyh"
|
||||||
|
"\"mjagins\xf9tqykaxy\""
|
||||||
|
"knvsdnmtr\"zervsb"
|
||||||
|
"hzuy"
|
||||||
|
"zza\"k\"buapb\\elm\xfeya"
|
||||||
|
"lrqar\"dfqwkaaqifig\"uixjsz"
|
||||||
|
"\"azuo\x40rmnlhhluwsbbdb\x32pk\\yu\"pbcf"
|
||||||
|
"dplkdyty"
|
||||||
|
"rfoyciebwlwphcycmguc"
|
||||||
|
"ivnmmiemhgytmlprq\\eh"
|
||||||
|
"lhkyzaaothfdhmbpsqd\\yyw"
|
||||||
|
"tnlzifupcjcaj"
|
||||||
|
"\\qiyirsdrfpmu\\\x15xusifaag"
|
||||||
|
"\\lcomf\\s"
|
||||||
|
"uramjivcirjhqcqcg"
|
||||||
|
"kkbaklbxfxikffnuhtu\xc6t\"d"
|
||||||
|
"n\xefai"
|
||||||
|
"\"toy\"bnbpevuzoc\"muywq\"gz\"grbm"
|
||||||
|
"\"muu\\wt"
|
||||||
|
"\\srby\"ee"
|
||||||
|
"erf\"gvw\"swfppf"
|
||||||
|
"pbqcgtn\"iuianhcdazfvmidn\\nslhxdf"
|
||||||
|
"uxbp"
|
||||||
|
"up\\mgrcyaegiwmjufn"
|
||||||
|
"nulscgcewj\\dvoyvhetdegzhs\""
|
||||||
|
"masv\"k\\rzrb"
|
||||||
|
"qtx\x79d\"xdxmbxrvhj"
|
||||||
|
"fid\\otpkgjlh\"qgsvexrckqtn\xf4"
|
||||||
|
"tagzu"
|
||||||
|
"bvl\\\"noseec"
|
||||||
|
"\\xgicuuh"
|
||||||
|
"w\"a\"npemf"
|
||||||
|
"sxp"
|
||||||
|
"nsmpktic\x8awxftscdcvijjobnq\"gjd"
|
||||||
|
"uks\"\"jxvyvfezz\"aynxoev\"cuoav"
|
||||||
|
"m"
|
||||||
|
"lkvokj"
|
||||||
|
"vkfam\"yllr\"q\x92o\x4ebecnvhshhqe\\"
|
||||||
|
"efdxcjkjverw"
|
||||||
|
"lmqzadwhfdgmep\x02tzfcbgrbfekhat"
|
||||||
|
"cpbk\x9azqegbpluczssouop\x36ztpuoxsw"
|
||||||
|
"cqwoczxdd\"erdjka"
|
||||||
|
"cwvqnjgbw\\fxdlby"
|
||||||
|
"mvtm"
|
||||||
|
"lt\"bbqzpumplkg"
|
||||||
|
"ntd\xeeuwweucnuuslqfzfq"
|
||||||
|
"y\xabl\"dbebxjrlbmuoo\\\x1au"
|
||||||
|
"qjoqx\\a"
|
||||||
|
"pu\"ekdnfpmly\xbago\""
|
||||||
|
"fjhhdy"
|
||||||
|
"arl"
|
||||||
|
"xcywisim\"bwuwf\"\"raepeawwjub"
|
||||||
|
"pbe"
|
||||||
|
"dbnqfpzyaumxtqnd\xc5dcqrkwyop"
|
||||||
|
"ojv\x40vtkwgkqepm\x8bzft\\vedrry"
|
||||||
|
"wggqkfbwqumsgajqwphjec\"mstxpwz"
|
||||||
|
"zjkbem"
|
||||||
|
"icpfqxbelxazlls"
|
||||||
|
"pvpqs\\abcmtyielugfgcv\"tjxapxqxnx"
|
||||||
|
"oqddwlvmtv\"\x39lyybylfb\"jmngnpjrdw"
|
||||||
|
"gisgbve"
|
||||||
|
"\"aglg"
|
||||||
|
"y\"\"ss\xafvhxlrjv"
|
||||||
|
"qbgqjsra"
|
||||||
|
"ihshbjgqpdcljpmdwdprwloy"
|
||||||
|
"djja\\wcdn\"svkrgpqn\"uz\"hc\x43hj"
|
||||||
|
"cbjm"
|
||||||
|
"pnn"
|
||||||
|
"pqvh\"noh"
|
||||||
|
"\"\\fdktlp"
|
||||||
|
"ncea"
|
||||||
|
"pqgzphiyy"
|
||||||
|
"\xbedovhxuipaohlcvkwtxwmpz\"ckaif\"r"
|
||||||
|
"arjuzbjowqciunfwgxtph\"vlhy\"n"
|
||||||
|
"c"
|
||||||
|
"nrpdxunulgudqzlhtae"
|
||||||
|
"iefheu\"uru\""
|
||||||
|
"aqijysxuijud\"np\\opbichhudil\xbesum"
|
||||||
|
"pfpevmtstl\"lde\"bzr\"vspdxs"
|
||||||
|
"vparfbdjwvzsocpnzhp"
|
||||||
|
"g\x4ffxaarafrsjthq\\\xc1rw"
|
||||||
|
"ng\\rqx\\gwpzucbh\xafl"
|
||||||
|
"rw\"nf\\dna"
|
||||||
|
"jkkeahxurxla\\g\xb3czrlsyimmwcwthr"
|
||||||
|
"twaailoypu\"oas\"kpuuyedlaw\\\xb0vzt"
|
||||||
|
"hznex\\gdiqvtugi"
|
||||||
|
"imdibsunjeswhk"
|
||||||
|
"ta\\icileuzpxro\"cfmv\"mzp"
|
||||||
|
"coykr\x57luiysucfaflmilhlehmvzeiepo"
|
||||||
|
"u\x3dfh\xd4yt"
|
||||||
|
"piw\x1bz\"eowy\"vfk\"wqiekw"
|
||||||
|
"gan\"y"
|
||||||
|
"p\"bevidoazcznr\"hddxuuq\""
|
||||||
|
"bwzucczznutbxe"
|
||||||
|
"z\"viqgyqjisior\\iecosmjbknol"
|
||||||
|
"dmlpcglcfkfsctxydjvayhymv\x3c\\gp"
|
||||||
|
"bfvkqrintbbvgfv"
|
||||||
|
"xlzntrgdck\"cprc\xadczyarbznqmuhxyuh"
|
||||||
|
"uqdxnuwioc\"kdytxq\\ig"
|
||||||
|
"xrafmucpmfi"
|
||||||
|
"vr\"hltmfrge"
|
||||||
|
"eonf\"nt\\wtcnsocs"
|
||||||
|
"j\xb7xoslyjeyjksplkqixncgkylkw"
|
||||||
|
"njw\"pefgfbez\x9axshdmplxzquqe"
|
||||||
|
"di\x58bvptfsafirpc"
|
||||||
|
"l\x1fkco"
|
||||||
|
"x"
|
||||||
|
"mprndo\"n"
|
||||||
|
"psegit"
|
||||||
|
"svbdnkkuuqs\"sqxu\"oqcyz\"aizashk"
|
||||||
|
"cwkljukxer\\\"\\nff\"esjwiyaoy"
|
||||||
|
"ilxrkgbjjxpvhdtq\"cpiuoofdnkpp"
|
||||||
|
"hlngi\"ulxep\\qohtmqnqjb\"rkgerho"
|
||||||
|
"gxws\"bcgm\"p"
|
||||||
|
"bv\"mds\\zhfusiepgrz\\b\x32fscdzz"
|
||||||
|
"l\xfampwtme\x69qvxnx\"\"\xc4jruuymjxrpsv"
|
||||||
|
"qqmxhrn"
|
||||||
|
"xziq\\\x18ybyv\x9am\"neacoqjzytertisysza"
|
||||||
|
"aqcbvlvcrzceeyx\\j\"\"x"
|
||||||
|
"yjuhhb"
|
||||||
|
"\x5em\"squulpy"
|
||||||
|
"dpbntplgmwb"
|
||||||
|
"utsgfkm\\vbftjknlktpthoeo"
|
||||||
|
"ccxjgiocmuhf\"ycnh"
|
||||||
|
"lltj\"kbbxi"
|
@ -0,0 +1,28 @@
|
|||||||
|
Tristram to AlphaCentauri = 34
|
||||||
|
Tristram to Snowdin = 100
|
||||||
|
Tristram to Tambi = 63
|
||||||
|
Tristram to Faerun = 108
|
||||||
|
Tristram to Norrath = 111
|
||||||
|
Tristram to Straylight = 89
|
||||||
|
Tristram to Arbre = 132
|
||||||
|
AlphaCentauri to Snowdin = 4
|
||||||
|
AlphaCentauri to Tambi = 79
|
||||||
|
AlphaCentauri to Faerun = 44
|
||||||
|
AlphaCentauri to Norrath = 147
|
||||||
|
AlphaCentauri to Straylight = 133
|
||||||
|
AlphaCentauri to Arbre = 74
|
||||||
|
Snowdin to Tambi = 105
|
||||||
|
Snowdin to Faerun = 95
|
||||||
|
Snowdin to Norrath = 48
|
||||||
|
Snowdin to Straylight = 88
|
||||||
|
Snowdin to Arbre = 7
|
||||||
|
Tambi to Faerun = 68
|
||||||
|
Tambi to Norrath = 134
|
||||||
|
Tambi to Straylight = 107
|
||||||
|
Tambi to Arbre = 40
|
||||||
|
Faerun to Norrath = 11
|
||||||
|
Faerun to Straylight = 66
|
||||||
|
Faerun to Arbre = 144
|
||||||
|
Norrath to Straylight = 115
|
||||||
|
Norrath to Arbre = 135
|
||||||
|
Straylight to Arbre = 127
|
@ -0,0 +1,80 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
|
||||||
|
@aoc-title[9]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket/day09]
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/9"]{The puzzle}. Our @link-rp["day09-input.txt"]{input} consists of a list of distances between fictional cities, e.g., @italic{AlphaCentauri to Straylight = 133}.
|
||||||
|
|
||||||
|
@chunk[<day09>
|
||||||
|
<day09-setup>
|
||||||
|
<day09-q1>
|
||||||
|
<day09-q2>
|
||||||
|
<day09-test>]
|
||||||
|
|
||||||
|
@section{What's the shortest route that visits all the cities?}
|
||||||
|
|
||||||
|
This puzzle is a version of the famous @link["https://simple.wikipedia.org/wiki/Travelling_salesman_problem"]{traveling-salesman problem}. The problem is famous because there's no reasonable algorithm to solve it for arbitrarily large sets of cities. This version, however, has only eight cities. So it is possible (and easiest) to simply try all the options and see which is shortest.
|
||||||
|
|
||||||
|
The solution has two parts. First, we'll parse our input data and put the distances into a mutable hash table. One small wrinkle — the distance between city A and city B is the same whether our path takes us from A to B or B to A. So the keys for our hash will be of the form @racket[(list city-a city-b)], with the cities always in alphabetical order.
|
||||||
|
|
||||||
|
In the second part, we'll loop through every possible path between the cities with @racket[in-permutations]. We'll split each path into pairs of cities, look up each distance between pairs, and sum them. This will give us a list of distances, and we can find the smallest with @racket[apply min].
|
||||||
|
|
||||||
|
@margin-note{The reason the traveling-saleman problem is generally difficult is that the number of permutations of @racket[_n] cities is @racket[(factorial (sub1 _n))], which gets very large, very quickly.}
|
||||||
|
|
||||||
|
@chunk[<day09-setup>
|
||||||
|
(require racket rackunit)
|
||||||
|
(provide (all-defined-out))
|
||||||
|
|
||||||
|
(define distances (make-hash))
|
||||||
|
|
||||||
|
(define (str->hash ln)
|
||||||
|
(match-define (list _ here there dist)
|
||||||
|
(regexp-match #px"^(\\w+) to (\\w+) = (\\d+)" ln))
|
||||||
|
(define key (places->key here there))
|
||||||
|
(hash-set! distances key (string->number dist)))
|
||||||
|
|
||||||
|
(define (places->key here there)
|
||||||
|
(sort (list (string-downcase here) (string-downcase there)) string<?))
|
||||||
|
|
||||||
|
(define (calculate-route-distances)
|
||||||
|
(define (pairify xs)
|
||||||
|
(map list (drop-right xs 1) (drop xs 1)))
|
||||||
|
(define (distance here there)
|
||||||
|
(hash-ref distances (places->key here there) +inf.0))
|
||||||
|
|
||||||
|
(define cities (remove-duplicates (append* (hash-keys distances))))
|
||||||
|
(for/list ([route (in-permutations cities)])
|
||||||
|
(for/sum ([pair (in-list (pairify route))])
|
||||||
|
(apply distance pair))))
|
||||||
|
]
|
||||||
|
|
||||||
|
@chunk[<day09-q1>
|
||||||
|
|
||||||
|
|
||||||
|
(define (q1 strs)
|
||||||
|
(for-each str->hash strs)
|
||||||
|
(apply min (calculate-route-distances)))]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section{What's the longest route?}
|
||||||
|
|
||||||
|
Exactly the same, except we look for the @racket[max] value among the distances rather than the @racket[min].
|
||||||
|
|
||||||
|
@chunk[<day09-q2>
|
||||||
|
|
||||||
|
(define (q2 strs)
|
||||||
|
(apply max (calculate-route-distances))) ]
|
||||||
|
|
||||||
|
|
||||||
|
@section{Testing Day 9}
|
||||||
|
|
||||||
|
@chunk[<day09-test>
|
||||||
|
(module+ test
|
||||||
|
(define input-strs (file->lines "day09-input.txt"))
|
||||||
|
(check-equal? (q1 input-strs) 251)
|
||||||
|
(check-equal? (q2 input-strs) 898))]
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
1321131112
|
@ -0,0 +1,66 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
|
||||||
|
@aoc-title[10]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket/day10]
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/10"]{The puzzle}. Our @link-rp["day10-input.txt"]{input} is a short numeric key.
|
||||||
|
|
||||||
|
@chunk[<day10>
|
||||||
|
<day10-setup>
|
||||||
|
<day10-q1>
|
||||||
|
<day10-q2>
|
||||||
|
<day10-test>]
|
||||||
|
|
||||||
|
@section{What's the length of the sequence after 40 iterations?}
|
||||||
|
|
||||||
|
The puzzle asks us to compute the @italic{look and say} sequence invented by mathematician John Conway. Each iteration of the sequence is the description of the last step if you said it in numbers. So @racket[1] becomes ``one 1'', written @racket[11]; @racket[11] becomes ``two ones'', or @racket[21], then @racket[1211], @racket[111221], and so on.
|
||||||
|
|
||||||
|
As in @secref{Day_1}, this puzzle relies on cumulative state, so we'll loop using @racket[for/fold]. To generate the new string for each pass of the loop, we'll use @racket[regexp-match*] to find every contiguous run of digits. Each digit run is converted into a list with the number of digits and the digit itself. Then all these lists are concatenated into a new string, and the loop repeats.
|
||||||
|
|
||||||
|
The second part of the puzzle is just going to change the number of iterations. So we'll make one function that can be used for both parts.
|
||||||
|
|
||||||
|
@chunk[<day10-setup>
|
||||||
|
(require racket rackunit)
|
||||||
|
(provide (all-defined-out))
|
||||||
|
|
||||||
|
(define (look-and-say iterations input-key)
|
||||||
|
(for/fold ([start input-key])
|
||||||
|
([i (in-range iterations)])
|
||||||
|
(define digit-runs (regexp-match* #px"(\\d)\\1*" start))
|
||||||
|
(string-append*
|
||||||
|
(map ~a
|
||||||
|
(append-map (λ(digit-run)
|
||||||
|
(list (string-length digit-run)
|
||||||
|
(substring digit-run 0 1)))
|
||||||
|
digit-runs)))))
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
@chunk[<day10-q1>
|
||||||
|
|
||||||
|
(define (q1 input-key)
|
||||||
|
(string-length (look-and-say 40 input-key)))]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section{After 50 iterations?}
|
||||||
|
|
||||||
|
We use the same @racket[look-and-say] function, but with an iteration argument of @racket[50] rather than @racket[40].
|
||||||
|
|
||||||
|
@chunk[<day10-q2>
|
||||||
|
|
||||||
|
(define (q2 input-key)
|
||||||
|
(string-length (look-and-say 50 input-key))) ]
|
||||||
|
|
||||||
|
|
||||||
|
@section{Testing Day 10}
|
||||||
|
|
||||||
|
@chunk[<day10-test>
|
||||||
|
(module+ test
|
||||||
|
(define input-key (file->string "day10-input.txt"))
|
||||||
|
(check-equal? (q1 input-key) 492982)
|
||||||
|
(check-equal? (q2 input-key) 6989950))]
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
hxbxwxba
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,56 @@
|
|||||||
|
Alice would gain 54 happiness units by sitting next to Bob.
|
||||||
|
Alice would lose 81 happiness units by sitting next to Carol.
|
||||||
|
Alice would lose 42 happiness units by sitting next to David.
|
||||||
|
Alice would gain 89 happiness units by sitting next to Eric.
|
||||||
|
Alice would lose 89 happiness units by sitting next to Frank.
|
||||||
|
Alice would gain 97 happiness units by sitting next to George.
|
||||||
|
Alice would lose 94 happiness units by sitting next to Mallory.
|
||||||
|
Bob would gain 3 happiness units by sitting next to Alice.
|
||||||
|
Bob would lose 70 happiness units by sitting next to Carol.
|
||||||
|
Bob would lose 31 happiness units by sitting next to David.
|
||||||
|
Bob would gain 72 happiness units by sitting next to Eric.
|
||||||
|
Bob would lose 25 happiness units by sitting next to Frank.
|
||||||
|
Bob would lose 95 happiness units by sitting next to George.
|
||||||
|
Bob would gain 11 happiness units by sitting next to Mallory.
|
||||||
|
Carol would lose 83 happiness units by sitting next to Alice.
|
||||||
|
Carol would gain 8 happiness units by sitting next to Bob.
|
||||||
|
Carol would gain 35 happiness units by sitting next to David.
|
||||||
|
Carol would gain 10 happiness units by sitting next to Eric.
|
||||||
|
Carol would gain 61 happiness units by sitting next to Frank.
|
||||||
|
Carol would gain 10 happiness units by sitting next to George.
|
||||||
|
Carol would gain 29 happiness units by sitting next to Mallory.
|
||||||
|
David would gain 67 happiness units by sitting next to Alice.
|
||||||
|
David would gain 25 happiness units by sitting next to Bob.
|
||||||
|
David would gain 48 happiness units by sitting next to Carol.
|
||||||
|
David would lose 65 happiness units by sitting next to Eric.
|
||||||
|
David would gain 8 happiness units by sitting next to Frank.
|
||||||
|
David would gain 84 happiness units by sitting next to George.
|
||||||
|
David would gain 9 happiness units by sitting next to Mallory.
|
||||||
|
Eric would lose 51 happiness units by sitting next to Alice.
|
||||||
|
Eric would lose 39 happiness units by sitting next to Bob.
|
||||||
|
Eric would gain 84 happiness units by sitting next to Carol.
|
||||||
|
Eric would lose 98 happiness units by sitting next to David.
|
||||||
|
Eric would lose 20 happiness units by sitting next to Frank.
|
||||||
|
Eric would lose 6 happiness units by sitting next to George.
|
||||||
|
Eric would gain 60 happiness units by sitting next to Mallory.
|
||||||
|
Frank would gain 51 happiness units by sitting next to Alice.
|
||||||
|
Frank would gain 79 happiness units by sitting next to Bob.
|
||||||
|
Frank would gain 88 happiness units by sitting next to Carol.
|
||||||
|
Frank would gain 33 happiness units by sitting next to David.
|
||||||
|
Frank would gain 43 happiness units by sitting next to Eric.
|
||||||
|
Frank would gain 77 happiness units by sitting next to George.
|
||||||
|
Frank would lose 3 happiness units by sitting next to Mallory.
|
||||||
|
George would lose 14 happiness units by sitting next to Alice.
|
||||||
|
George would lose 12 happiness units by sitting next to Bob.
|
||||||
|
George would lose 52 happiness units by sitting next to Carol.
|
||||||
|
George would gain 14 happiness units by sitting next to David.
|
||||||
|
George would lose 62 happiness units by sitting next to Eric.
|
||||||
|
George would lose 18 happiness units by sitting next to Frank.
|
||||||
|
George would lose 17 happiness units by sitting next to Mallory.
|
||||||
|
Mallory would lose 36 happiness units by sitting next to Alice.
|
||||||
|
Mallory would gain 76 happiness units by sitting next to Bob.
|
||||||
|
Mallory would lose 34 happiness units by sitting next to Carol.
|
||||||
|
Mallory would gain 37 happiness units by sitting next to David.
|
||||||
|
Mallory would gain 40 happiness units by sitting next to Eric.
|
||||||
|
Mallory would gain 18 happiness units by sitting next to Frank.
|
||||||
|
Mallory would gain 7 happiness units by sitting next to George.
|
@ -0,0 +1,9 @@
|
|||||||
|
Dancer can fly 27 km/s for 5 seconds, but then must rest for 132 seconds.
|
||||||
|
Cupid can fly 22 km/s for 2 seconds, but then must rest for 41 seconds.
|
||||||
|
Rudolph can fly 11 km/s for 5 seconds, but then must rest for 48 seconds.
|
||||||
|
Donner can fly 28 km/s for 5 seconds, but then must rest for 134 seconds.
|
||||||
|
Dasher can fly 4 km/s for 16 seconds, but then must rest for 55 seconds.
|
||||||
|
Blitzen can fly 14 km/s for 3 seconds, but then must rest for 38 seconds.
|
||||||
|
Prancer can fly 3 km/s for 21 seconds, but then must rest for 40 seconds.
|
||||||
|
Comet can fly 18 km/s for 6 seconds, but then must rest for 103 seconds.
|
||||||
|
Vixen can fly 18 km/s for 5 seconds, but then must rest for 84 seconds.
|
@ -0,0 +1,4 @@
|
|||||||
|
Frosting: capacity 4, durability -2, flavor 0, texture 0, calories 5
|
||||||
|
Candy: capacity 0, durability 5, flavor -1, texture 0, calories 8
|
||||||
|
Butterscotch: capacity -1, durability 0, flavor 5, texture 0, calories 6
|
||||||
|
Sugar: capacity 0, durability 0, flavor -2, texture 2, calories 1
|
@ -0,0 +1,10 @@
|
|||||||
|
children: 3
|
||||||
|
cats: 7
|
||||||
|
samoyeds: 2
|
||||||
|
pomeranians: 3
|
||||||
|
akitas: 0
|
||||||
|
vizslas: 0
|
||||||
|
goldfish: 5
|
||||||
|
trees: 3
|
||||||
|
cars: 2
|
||||||
|
perfumes: 1
|
@ -0,0 +1,500 @@
|
|||||||
|
Sue 1: goldfish: 6, trees: 9, akitas: 0
|
||||||
|
Sue 2: goldfish: 7, trees: 1, akitas: 0
|
||||||
|
Sue 3: cars: 10, akitas: 6, perfumes: 7
|
||||||
|
Sue 4: perfumes: 2, vizslas: 0, cars: 6
|
||||||
|
Sue 5: goldfish: 1, trees: 3, perfumes: 10
|
||||||
|
Sue 6: children: 9, vizslas: 7, cars: 9
|
||||||
|
Sue 7: cars: 6, vizslas: 5, cats: 3
|
||||||
|
Sue 8: akitas: 10, vizslas: 9, children: 3
|
||||||
|
Sue 9: vizslas: 8, cats: 2, trees: 1
|
||||||
|
Sue 10: perfumes: 10, trees: 6, cars: 4
|
||||||
|
Sue 11: cars: 9, children: 1, cats: 1
|
||||||
|
Sue 12: pomeranians: 4, akitas: 6, goldfish: 8
|
||||||
|
Sue 13: cats: 10, children: 5, trees: 9
|
||||||
|
Sue 14: perfumes: 8, vizslas: 3, samoyeds: 1
|
||||||
|
Sue 15: vizslas: 2, perfumes: 8, trees: 3
|
||||||
|
Sue 16: pomeranians: 10, trees: 9, samoyeds: 4
|
||||||
|
Sue 17: akitas: 7, vizslas: 0, goldfish: 6
|
||||||
|
Sue 18: trees: 5, vizslas: 9, cars: 0
|
||||||
|
Sue 19: akitas: 3, goldfish: 9, trees: 10
|
||||||
|
Sue 20: perfumes: 7, samoyeds: 3, vizslas: 10
|
||||||
|
Sue 21: perfumes: 7, pomeranians: 10, akitas: 8
|
||||||
|
Sue 22: vizslas: 6, trees: 8, akitas: 10
|
||||||
|
Sue 23: goldfish: 0, trees: 4, children: 9
|
||||||
|
Sue 24: goldfish: 7, pomeranians: 9, akitas: 4
|
||||||
|
Sue 25: cars: 7, trees: 4, pomeranians: 4
|
||||||
|
Sue 26: trees: 9, akitas: 9, pomeranians: 7
|
||||||
|
Sue 27: samoyeds: 0, perfumes: 9, goldfish: 10
|
||||||
|
Sue 28: cars: 5, trees: 7, vizslas: 1
|
||||||
|
Sue 29: perfumes: 9, trees: 1, children: 6
|
||||||
|
Sue 30: goldfish: 10, trees: 0, cars: 4
|
||||||
|
Sue 31: akitas: 2, perfumes: 5, goldfish: 5
|
||||||
|
Sue 32: goldfish: 0, akitas: 5, trees: 0
|
||||||
|
Sue 33: vizslas: 2, akitas: 2, samoyeds: 3
|
||||||
|
Sue 34: goldfish: 8, perfumes: 5, cars: 3
|
||||||
|
Sue 35: akitas: 1, cats: 4, trees: 9
|
||||||
|
Sue 36: cars: 4, vizslas: 4, goldfish: 7
|
||||||
|
Sue 37: akitas: 5, perfumes: 7, trees: 3
|
||||||
|
Sue 38: goldfish: 10, trees: 2, vizslas: 9
|
||||||
|
Sue 39: goldfish: 4, pomeranians: 5, vizslas: 5
|
||||||
|
Sue 40: perfumes: 5, samoyeds: 4, akitas: 6
|
||||||
|
Sue 41: goldfish: 9, cars: 4, perfumes: 5
|
||||||
|
Sue 42: trees: 6, pomeranians: 9, goldfish: 8
|
||||||
|
Sue 43: perfumes: 7, pomeranians: 1, akitas: 2
|
||||||
|
Sue 44: vizslas: 9, cars: 5, cats: 0
|
||||||
|
Sue 45: akitas: 1, goldfish: 6, trees: 0
|
||||||
|
Sue 46: akitas: 5, vizslas: 8, trees: 2
|
||||||
|
Sue 47: trees: 9, akitas: 2, vizslas: 9
|
||||||
|
Sue 48: goldfish: 10, trees: 5, akitas: 2
|
||||||
|
Sue 49: cars: 7, vizslas: 2, perfumes: 6
|
||||||
|
Sue 50: akitas: 5, goldfish: 6, perfumes: 0
|
||||||
|
Sue 51: cars: 9, cats: 7, trees: 5
|
||||||
|
Sue 52: akitas: 7, goldfish: 10, cars: 0
|
||||||
|
Sue 53: cars: 10, cats: 4, perfumes: 2
|
||||||
|
Sue 54: goldfish: 2, pomeranians: 5, perfumes: 10
|
||||||
|
Sue 55: vizslas: 5, akitas: 4, cars: 8
|
||||||
|
Sue 56: goldfish: 9, vizslas: 4, akitas: 5
|
||||||
|
Sue 57: perfumes: 8, samoyeds: 7, cars: 9
|
||||||
|
Sue 58: cars: 5, akitas: 7, perfumes: 8
|
||||||
|
Sue 59: samoyeds: 8, cars: 10, vizslas: 10
|
||||||
|
Sue 60: akitas: 6, samoyeds: 0, goldfish: 3
|
||||||
|
Sue 61: trees: 8, pomeranians: 0, akitas: 2
|
||||||
|
Sue 62: trees: 1, perfumes: 3, vizslas: 4
|
||||||
|
Sue 63: vizslas: 6, samoyeds: 9, goldfish: 8
|
||||||
|
Sue 64: goldfish: 7, trees: 6, vizslas: 3
|
||||||
|
Sue 65: cars: 1, vizslas: 0, akitas: 6
|
||||||
|
Sue 66: cats: 6, pomeranians: 4, cars: 9
|
||||||
|
Sue 67: trees: 10, pomeranians: 7, samoyeds: 3
|
||||||
|
Sue 68: pomeranians: 5, goldfish: 9, akitas: 1
|
||||||
|
Sue 69: akitas: 1, vizslas: 0, trees: 9
|
||||||
|
Sue 70: cats: 4, goldfish: 4, vizslas: 10
|
||||||
|
Sue 71: vizslas: 7, perfumes: 7, trees: 8
|
||||||
|
Sue 72: children: 2, vizslas: 9, cats: 3
|
||||||
|
Sue 73: cars: 8, pomeranians: 0, perfumes: 6
|
||||||
|
Sue 74: akitas: 1, pomeranians: 8, vizslas: 10
|
||||||
|
Sue 75: vizslas: 5, perfumes: 5, cars: 7
|
||||||
|
Sue 76: cars: 3, vizslas: 3, goldfish: 0
|
||||||
|
Sue 77: akitas: 9, samoyeds: 1, pomeranians: 3
|
||||||
|
Sue 78: trees: 0, vizslas: 0, akitas: 6
|
||||||
|
Sue 79: pomeranians: 9, cars: 1, perfumes: 0
|
||||||
|
Sue 80: perfumes: 10, trees: 1, cats: 0
|
||||||
|
Sue 81: goldfish: 5, akitas: 9, trees: 0
|
||||||
|
Sue 82: vizslas: 1, akitas: 6, children: 4
|
||||||
|
Sue 83: samoyeds: 7, perfumes: 8, pomeranians: 4
|
||||||
|
Sue 84: perfumes: 3, children: 3, cats: 7
|
||||||
|
Sue 85: goldfish: 9, trees: 3, cars: 9
|
||||||
|
Sue 86: cars: 0, perfumes: 9, vizslas: 0
|
||||||
|
Sue 87: children: 3, trees: 4, akitas: 3
|
||||||
|
Sue 88: trees: 1, samoyeds: 1, goldfish: 0
|
||||||
|
Sue 89: akitas: 8, cars: 3, vizslas: 9
|
||||||
|
Sue 90: pomeranians: 9, trees: 9, goldfish: 8
|
||||||
|
Sue 91: goldfish: 7, trees: 10, children: 0
|
||||||
|
Sue 92: cats: 9, cars: 7, perfumes: 7
|
||||||
|
Sue 93: vizslas: 2, goldfish: 7, cats: 9
|
||||||
|
Sue 94: akitas: 5, cars: 8, vizslas: 4
|
||||||
|
Sue 95: goldfish: 7, vizslas: 1, perfumes: 2
|
||||||
|
Sue 96: goldfish: 5, trees: 6, perfumes: 10
|
||||||
|
Sue 97: trees: 0, perfumes: 7, cars: 0
|
||||||
|
Sue 98: cars: 2, perfumes: 6, trees: 8
|
||||||
|
Sue 99: trees: 10, children: 7, cats: 9
|
||||||
|
Sue 100: samoyeds: 5, goldfish: 6, vizslas: 6
|
||||||
|
Sue 101: cars: 10, perfumes: 9, vizslas: 3
|
||||||
|
Sue 102: pomeranians: 6, trees: 1, samoyeds: 4
|
||||||
|
Sue 103: cars: 2, perfumes: 1, goldfish: 5
|
||||||
|
Sue 104: goldfish: 2, cars: 8, pomeranians: 2
|
||||||
|
Sue 105: goldfish: 6, vizslas: 0, trees: 10
|
||||||
|
Sue 106: trees: 10, akitas: 10, pomeranians: 0
|
||||||
|
Sue 107: vizslas: 2, pomeranians: 10, trees: 3
|
||||||
|
Sue 108: children: 3, vizslas: 8, akitas: 7
|
||||||
|
Sue 109: perfumes: 2, akitas: 2, samoyeds: 3
|
||||||
|
Sue 110: goldfish: 7, trees: 1, perfumes: 1
|
||||||
|
Sue 111: akitas: 2, cars: 9, perfumes: 2
|
||||||
|
Sue 112: children: 10, cars: 0, akitas: 3
|
||||||
|
Sue 113: akitas: 9, vizslas: 4, children: 3
|
||||||
|
Sue 114: pomeranians: 3, trees: 2, goldfish: 5
|
||||||
|
Sue 115: perfumes: 8, cars: 6, trees: 0
|
||||||
|
Sue 116: samoyeds: 6, children: 3, pomeranians: 1
|
||||||
|
Sue 117: goldfish: 1, trees: 2, akitas: 1
|
||||||
|
Sue 118: goldfish: 10, akitas: 10, samoyeds: 0
|
||||||
|
Sue 119: vizslas: 10, perfumes: 6, cars: 0
|
||||||
|
Sue 120: cars: 2, perfumes: 9, goldfish: 5
|
||||||
|
Sue 121: vizslas: 2, trees: 2, cars: 6
|
||||||
|
Sue 122: vizslas: 3, trees: 0, akitas: 2
|
||||||
|
Sue 123: akitas: 5, samoyeds: 7, goldfish: 1
|
||||||
|
Sue 124: goldfish: 8, samoyeds: 7, trees: 8
|
||||||
|
Sue 125: trees: 3, goldfish: 8, perfumes: 5
|
||||||
|
Sue 126: cats: 3, vizslas: 9, goldfish: 0
|
||||||
|
Sue 127: pomeranians: 9, goldfish: 3, perfumes: 6
|
||||||
|
Sue 128: vizslas: 4, cars: 8, goldfish: 5
|
||||||
|
Sue 129: vizslas: 8, children: 5, perfumes: 8
|
||||||
|
Sue 130: cars: 7, children: 7, cats: 3
|
||||||
|
Sue 131: perfumes: 1, akitas: 8, vizslas: 9
|
||||||
|
Sue 132: perfumes: 7, samoyeds: 10, pomeranians: 6
|
||||||
|
Sue 133: cars: 5, perfumes: 3, goldfish: 7
|
||||||
|
Sue 134: perfumes: 9, akitas: 2, cats: 3
|
||||||
|
Sue 135: perfumes: 1, trees: 9, vizslas: 9
|
||||||
|
Sue 136: akitas: 7, cars: 3, perfumes: 7
|
||||||
|
Sue 137: vizslas: 9, goldfish: 8, cars: 5
|
||||||
|
Sue 138: trees: 0, samoyeds: 1, cars: 3
|
||||||
|
Sue 139: cars: 0, perfumes: 6, trees: 0
|
||||||
|
Sue 140: pomeranians: 4, cars: 1, perfumes: 7
|
||||||
|
Sue 141: vizslas: 10, akitas: 8, cats: 3
|
||||||
|
Sue 142: trees: 1, cats: 6, vizslas: 5
|
||||||
|
Sue 143: pomeranians: 9, cars: 7, perfumes: 9
|
||||||
|
Sue 144: cars: 0, perfumes: 2, pomeranians: 1
|
||||||
|
Sue 145: trees: 1, goldfish: 9, perfumes: 8
|
||||||
|
Sue 146: cars: 8, children: 5, vizslas: 2
|
||||||
|
Sue 147: perfumes: 2, goldfish: 5, cars: 0
|
||||||
|
Sue 148: akitas: 2, perfumes: 7, pomeranians: 6
|
||||||
|
Sue 149: goldfish: 8, cars: 0, trees: 1
|
||||||
|
Sue 150: akitas: 6, perfumes: 5, trees: 0
|
||||||
|
Sue 151: vizslas: 6, samoyeds: 8, akitas: 10
|
||||||
|
Sue 152: trees: 7, akitas: 7, perfumes: 6
|
||||||
|
Sue 153: goldfish: 9, cats: 9, cars: 3
|
||||||
|
Sue 154: vizslas: 10, trees: 0, cars: 9
|
||||||
|
Sue 155: perfumes: 3, children: 2, goldfish: 1
|
||||||
|
Sue 156: goldfish: 7, perfumes: 5, akitas: 6
|
||||||
|
Sue 157: cats: 10, trees: 1, goldfish: 0
|
||||||
|
Sue 158: cats: 7, children: 7, vizslas: 6
|
||||||
|
Sue 159: perfumes: 9, akitas: 0, cars: 0
|
||||||
|
Sue 160: akitas: 3, goldfish: 10, pomeranians: 2
|
||||||
|
Sue 161: goldfish: 10, cars: 6, perfumes: 3
|
||||||
|
Sue 162: trees: 0, cars: 9, goldfish: 1
|
||||||
|
Sue 163: cars: 8, perfumes: 9, vizslas: 5
|
||||||
|
Sue 164: goldfish: 1, trees: 10, children: 6
|
||||||
|
Sue 165: goldfish: 0, vizslas: 6, cars: 0
|
||||||
|
Sue 166: akitas: 5, vizslas: 1, cars: 5
|
||||||
|
Sue 167: vizslas: 1, samoyeds: 1, children: 4
|
||||||
|
Sue 168: samoyeds: 7, vizslas: 7, akitas: 3
|
||||||
|
Sue 169: goldfish: 3, cats: 9, trees: 2
|
||||||
|
Sue 170: cars: 5, perfumes: 9, vizslas: 5
|
||||||
|
Sue 171: goldfish: 7, cars: 6, perfumes: 10
|
||||||
|
Sue 172: cats: 6, akitas: 1, children: 6
|
||||||
|
Sue 173: cats: 4, goldfish: 1, children: 3
|
||||||
|
Sue 174: cars: 2, pomeranians: 2, vizslas: 7
|
||||||
|
Sue 175: trees: 0, children: 4, goldfish: 7
|
||||||
|
Sue 176: children: 8, cars: 5, cats: 9
|
||||||
|
Sue 177: pomeranians: 4, vizslas: 7, trees: 3
|
||||||
|
Sue 178: vizslas: 6, perfumes: 10, akitas: 6
|
||||||
|
Sue 179: cars: 4, akitas: 4, trees: 4
|
||||||
|
Sue 180: akitas: 8, goldfish: 6, trees: 9
|
||||||
|
Sue 181: perfumes: 3, vizslas: 10, cars: 3
|
||||||
|
Sue 182: vizslas: 3, samoyeds: 3, goldfish: 7
|
||||||
|
Sue 183: goldfish: 10, perfumes: 2, cats: 1
|
||||||
|
Sue 184: goldfish: 5, trees: 1, perfumes: 1
|
||||||
|
Sue 185: vizslas: 10, trees: 9, perfumes: 2
|
||||||
|
Sue 186: goldfish: 6, perfumes: 9, trees: 1
|
||||||
|
Sue 187: cars: 0, trees: 9, goldfish: 6
|
||||||
|
Sue 188: cars: 0, trees: 1, vizslas: 9
|
||||||
|
Sue 189: akitas: 7, vizslas: 2, trees: 0
|
||||||
|
Sue 190: pomeranians: 5, perfumes: 8, akitas: 10
|
||||||
|
Sue 191: vizslas: 5, akitas: 3, cats: 0
|
||||||
|
Sue 192: children: 1, trees: 1, cars: 2
|
||||||
|
Sue 193: cars: 3, goldfish: 9, trees: 2
|
||||||
|
Sue 194: samoyeds: 3, akitas: 4, perfumes: 8
|
||||||
|
Sue 195: trees: 1, vizslas: 8, akitas: 10
|
||||||
|
Sue 196: akitas: 6, cars: 5, pomeranians: 0
|
||||||
|
Sue 197: akitas: 5, vizslas: 5, cats: 1
|
||||||
|
Sue 198: trees: 4, cars: 6, goldfish: 6
|
||||||
|
Sue 199: cats: 7, cars: 5, goldfish: 6
|
||||||
|
Sue 200: vizslas: 4, cats: 0, akitas: 9
|
||||||
|
Sue 201: pomeranians: 1, perfumes: 4, children: 2
|
||||||
|
Sue 202: cats: 1, perfumes: 4, vizslas: 3
|
||||||
|
Sue 203: vizslas: 1, akitas: 9, children: 5
|
||||||
|
Sue 204: perfumes: 8, cars: 7, trees: 4
|
||||||
|
Sue 205: perfumes: 7, pomeranians: 5, cats: 9
|
||||||
|
Sue 206: vizslas: 8, trees: 2, akitas: 2
|
||||||
|
Sue 207: akitas: 6, vizslas: 2, perfumes: 10
|
||||||
|
Sue 208: vizslas: 1, children: 7, akitas: 4
|
||||||
|
Sue 209: perfumes: 4, trees: 2, children: 1
|
||||||
|
Sue 210: goldfish: 0, vizslas: 2, samoyeds: 10
|
||||||
|
Sue 211: cars: 8, perfumes: 3, trees: 1
|
||||||
|
Sue 212: cars: 8, samoyeds: 5, pomeranians: 8
|
||||||
|
Sue 213: akitas: 2, goldfish: 8, pomeranians: 2
|
||||||
|
Sue 214: akitas: 6, pomeranians: 2, cars: 0
|
||||||
|
Sue 215: trees: 10, pomeranians: 4, vizslas: 0
|
||||||
|
Sue 216: perfumes: 0, cars: 8, trees: 0
|
||||||
|
Sue 217: samoyeds: 8, akitas: 7, children: 10
|
||||||
|
Sue 218: perfumes: 1, vizslas: 6, children: 0
|
||||||
|
Sue 219: children: 1, goldfish: 4, trees: 1
|
||||||
|
Sue 220: akitas: 10, goldfish: 10, trees: 5
|
||||||
|
Sue 221: cars: 7, pomeranians: 6, perfumes: 3
|
||||||
|
Sue 222: vizslas: 6, children: 0, akitas: 5
|
||||||
|
Sue 223: perfumes: 9, cars: 1, trees: 6
|
||||||
|
Sue 224: pomeranians: 1, trees: 0, vizslas: 0
|
||||||
|
Sue 225: goldfish: 8, akitas: 4, perfumes: 10
|
||||||
|
Sue 226: pomeranians: 7, cats: 7, children: 4
|
||||||
|
Sue 227: trees: 0, akitas: 2, perfumes: 1
|
||||||
|
Sue 228: vizslas: 6, cars: 10, perfumes: 9
|
||||||
|
Sue 229: cars: 0, perfumes: 6, trees: 4
|
||||||
|
Sue 230: pomeranians: 7, perfumes: 5, trees: 2
|
||||||
|
Sue 231: goldfish: 9, cars: 6, trees: 7
|
||||||
|
Sue 232: akitas: 1, vizslas: 5, cars: 3
|
||||||
|
Sue 233: akitas: 7, samoyeds: 2, vizslas: 5
|
||||||
|
Sue 234: akitas: 6, cats: 8, pomeranians: 0
|
||||||
|
Sue 235: pomeranians: 5, akitas: 5, vizslas: 3
|
||||||
|
Sue 236: goldfish: 5, trees: 6, akitas: 5
|
||||||
|
Sue 237: goldfish: 9, perfumes: 5, cats: 5
|
||||||
|
Sue 238: cats: 8, goldfish: 4, perfumes: 0
|
||||||
|
Sue 239: samoyeds: 8, children: 6, pomeranians: 6
|
||||||
|
Sue 240: akitas: 4, samoyeds: 10, trees: 8
|
||||||
|
Sue 241: trees: 2, goldfish: 8, cars: 1
|
||||||
|
Sue 242: perfumes: 2, cars: 0, akitas: 10
|
||||||
|
Sue 243: pomeranians: 1, cars: 7, trees: 2
|
||||||
|
Sue 244: trees: 9, vizslas: 2, akitas: 10
|
||||||
|
Sue 245: cars: 9, pomeranians: 4, trees: 0
|
||||||
|
Sue 246: cars: 9, pomeranians: 7, perfumes: 1
|
||||||
|
Sue 247: trees: 0, goldfish: 1, akitas: 8
|
||||||
|
Sue 248: vizslas: 1, cats: 4, akitas: 4
|
||||||
|
Sue 249: cats: 6, children: 4, goldfish: 9
|
||||||
|
Sue 250: vizslas: 1, cars: 10, samoyeds: 5
|
||||||
|
Sue 251: cars: 0, goldfish: 1, vizslas: 7
|
||||||
|
Sue 252: cars: 7, akitas: 9, vizslas: 10
|
||||||
|
Sue 253: akitas: 7, vizslas: 2, perfumes: 5
|
||||||
|
Sue 254: vizslas: 10, akitas: 5, samoyeds: 0
|
||||||
|
Sue 255: pomeranians: 8, goldfish: 0, cats: 6
|
||||||
|
Sue 256: cars: 10, goldfish: 8, vizslas: 9
|
||||||
|
Sue 257: goldfish: 3, perfumes: 9, cats: 3
|
||||||
|
Sue 258: trees: 6, goldfish: 6, cars: 6
|
||||||
|
Sue 259: trees: 0, goldfish: 2, perfumes: 8
|
||||||
|
Sue 260: trees: 5, akitas: 0, cars: 0
|
||||||
|
Sue 261: pomeranians: 9, goldfish: 7, perfumes: 8
|
||||||
|
Sue 262: perfumes: 8, vizslas: 6, goldfish: 2
|
||||||
|
Sue 263: vizslas: 6, trees: 5, goldfish: 9
|
||||||
|
Sue 264: vizslas: 4, perfumes: 7, cars: 9
|
||||||
|
Sue 265: goldfish: 10, trees: 3, perfumes: 1
|
||||||
|
Sue 266: trees: 10, akitas: 8, goldfish: 8
|
||||||
|
Sue 267: goldfish: 4, trees: 0, samoyeds: 9
|
||||||
|
Sue 268: vizslas: 1, trees: 0, goldfish: 8
|
||||||
|
Sue 269: cars: 2, perfumes: 10, goldfish: 5
|
||||||
|
Sue 270: perfumes: 7, cars: 2, vizslas: 1
|
||||||
|
Sue 271: cars: 6, perfumes: 10, goldfish: 6
|
||||||
|
Sue 272: samoyeds: 4, goldfish: 2, vizslas: 9
|
||||||
|
Sue 273: perfumes: 4, goldfish: 4, vizslas: 1
|
||||||
|
Sue 274: children: 4, cars: 4, perfumes: 3
|
||||||
|
Sue 275: children: 8, vizslas: 3, trees: 2
|
||||||
|
Sue 276: vizslas: 5, children: 7, perfumes: 3
|
||||||
|
Sue 277: perfumes: 3, cats: 4, vizslas: 5
|
||||||
|
Sue 278: cars: 1, samoyeds: 10, akitas: 2
|
||||||
|
Sue 279: trees: 9, perfumes: 9, cars: 10
|
||||||
|
Sue 280: vizslas: 5, trees: 0, perfumes: 6
|
||||||
|
Sue 281: vizslas: 3, akitas: 10, pomeranians: 7
|
||||||
|
Sue 282: trees: 1, children: 2, akitas: 8
|
||||||
|
Sue 283: akitas: 9, goldfish: 6, cats: 5
|
||||||
|
Sue 284: cars: 9, children: 10, pomeranians: 2
|
||||||
|
Sue 285: pomeranians: 0, perfumes: 4, cars: 7
|
||||||
|
Sue 286: perfumes: 0, vizslas: 10, akitas: 10
|
||||||
|
Sue 287: cats: 2, perfumes: 3, trees: 5
|
||||||
|
Sue 288: akitas: 9, vizslas: 8, samoyeds: 9
|
||||||
|
Sue 289: perfumes: 6, children: 2, cars: 7
|
||||||
|
Sue 290: akitas: 0, children: 5, cars: 5
|
||||||
|
Sue 291: cars: 4, perfumes: 0, trees: 1
|
||||||
|
Sue 292: cats: 0, cars: 8, perfumes: 6
|
||||||
|
Sue 293: akitas: 9, cats: 5, children: 5
|
||||||
|
Sue 294: akitas: 4, cars: 9, goldfish: 3
|
||||||
|
Sue 295: cars: 2, akitas: 3, perfumes: 7
|
||||||
|
Sue 296: perfumes: 4, cars: 7, goldfish: 10
|
||||||
|
Sue 297: trees: 5, akitas: 8, vizslas: 1
|
||||||
|
Sue 298: perfumes: 0, goldfish: 6, trees: 9
|
||||||
|
Sue 299: perfumes: 6, samoyeds: 8, cars: 1
|
||||||
|
Sue 300: goldfish: 10, perfumes: 4, akitas: 2
|
||||||
|
Sue 301: cars: 3, trees: 0, goldfish: 8
|
||||||
|
Sue 302: perfumes: 7, samoyeds: 2, vizslas: 7
|
||||||
|
Sue 303: children: 10, goldfish: 7, perfumes: 2
|
||||||
|
Sue 304: samoyeds: 8, vizslas: 2, cars: 1
|
||||||
|
Sue 305: trees: 1, cats: 0, goldfish: 10
|
||||||
|
Sue 306: trees: 4, perfumes: 2, cars: 7
|
||||||
|
Sue 307: cars: 6, vizslas: 2, children: 6
|
||||||
|
Sue 308: vizslas: 2, cars: 0, akitas: 7
|
||||||
|
Sue 309: cars: 3, vizslas: 8, perfumes: 6
|
||||||
|
Sue 310: goldfish: 7, perfumes: 7, vizslas: 3
|
||||||
|
Sue 311: pomeranians: 10, trees: 2, cars: 0
|
||||||
|
Sue 312: samoyeds: 2, vizslas: 9, akitas: 1
|
||||||
|
Sue 313: cars: 4, pomeranians: 7, goldfish: 7
|
||||||
|
Sue 314: akitas: 2, pomeranians: 9, samoyeds: 10
|
||||||
|
Sue 315: akitas: 3, vizslas: 2, trees: 0
|
||||||
|
Sue 316: cars: 0, perfumes: 4, pomeranians: 6
|
||||||
|
Sue 317: akitas: 10, goldfish: 3, pomeranians: 7
|
||||||
|
Sue 318: cars: 9, trees: 0, pomeranians: 9
|
||||||
|
Sue 319: akitas: 3, vizslas: 7, children: 10
|
||||||
|
Sue 320: vizslas: 0, akitas: 8, pomeranians: 4
|
||||||
|
Sue 321: cars: 10, akitas: 9, vizslas: 3
|
||||||
|
Sue 322: perfumes: 0, akitas: 8, vizslas: 6
|
||||||
|
Sue 323: vizslas: 10, perfumes: 5, cars: 3
|
||||||
|
Sue 324: akitas: 0, goldfish: 6, vizslas: 7
|
||||||
|
Sue 325: perfumes: 9, vizslas: 5, pomeranians: 2
|
||||||
|
Sue 326: vizslas: 6, goldfish: 10, pomeranians: 8
|
||||||
|
Sue 327: vizslas: 10, cars: 1, akitas: 7
|
||||||
|
Sue 328: trees: 1, perfumes: 10, cars: 10
|
||||||
|
Sue 329: pomeranians: 5, samoyeds: 3, cars: 10
|
||||||
|
Sue 330: akitas: 6, cars: 1, pomeranians: 4
|
||||||
|
Sue 331: cars: 5, children: 2, trees: 0
|
||||||
|
Sue 332: vizslas: 6, pomeranians: 1, perfumes: 0
|
||||||
|
Sue 333: akitas: 7, trees: 1, cats: 9
|
||||||
|
Sue 334: vizslas: 6, goldfish: 9, akitas: 7
|
||||||
|
Sue 335: akitas: 3, samoyeds: 3, cars: 3
|
||||||
|
Sue 336: samoyeds: 10, perfumes: 9, trees: 6
|
||||||
|
Sue 337: vizslas: 2, cars: 9, akitas: 0
|
||||||
|
Sue 338: akitas: 6, perfumes: 9, vizslas: 3
|
||||||
|
Sue 339: cars: 3, samoyeds: 8, trees: 2
|
||||||
|
Sue 340: cats: 7, perfumes: 8, cars: 9
|
||||||
|
Sue 341: goldfish: 9, perfumes: 5, cars: 10
|
||||||
|
Sue 342: trees: 0, akitas: 3, perfumes: 5
|
||||||
|
Sue 343: perfumes: 2, children: 0, cars: 6
|
||||||
|
Sue 344: goldfish: 8, trees: 8, perfumes: 0
|
||||||
|
Sue 345: perfumes: 6, cars: 6, goldfish: 5
|
||||||
|
Sue 346: vizslas: 8, trees: 1, cars: 6
|
||||||
|
Sue 347: cars: 0, cats: 3, perfumes: 7
|
||||||
|
Sue 348: children: 7, perfumes: 10, cars: 7
|
||||||
|
Sue 349: pomeranians: 8, akitas: 5, children: 2
|
||||||
|
Sue 350: perfumes: 9, pomeranians: 4, goldfish: 3
|
||||||
|
Sue 351: perfumes: 8, pomeranians: 7, trees: 4
|
||||||
|
Sue 352: samoyeds: 1, goldfish: 9, akitas: 8
|
||||||
|
Sue 353: akitas: 6, goldfish: 10, vizslas: 8
|
||||||
|
Sue 354: akitas: 7, cars: 2, goldfish: 6
|
||||||
|
Sue 355: cars: 3, goldfish: 6, akitas: 5
|
||||||
|
Sue 356: akitas: 2, goldfish: 9, pomeranians: 1
|
||||||
|
Sue 357: goldfish: 10, cars: 6, pomeranians: 9
|
||||||
|
Sue 358: trees: 0, children: 2, goldfish: 6
|
||||||
|
Sue 359: samoyeds: 3, cars: 2, akitas: 4
|
||||||
|
Sue 360: trees: 1, goldfish: 8, cars: 5
|
||||||
|
Sue 361: akitas: 5, vizslas: 7, perfumes: 1
|
||||||
|
Sue 362: cats: 5, vizslas: 9, children: 4
|
||||||
|
Sue 363: goldfish: 9, perfumes: 3, vizslas: 9
|
||||||
|
Sue 364: children: 7, samoyeds: 2, pomeranians: 10
|
||||||
|
Sue 365: perfumes: 9, akitas: 10, pomeranians: 4
|
||||||
|
Sue 366: cars: 10, trees: 3, cats: 4
|
||||||
|
Sue 367: vizslas: 6, akitas: 10, perfumes: 5
|
||||||
|
Sue 368: akitas: 9, vizslas: 9, children: 4
|
||||||
|
Sue 369: goldfish: 8, trees: 2, perfumes: 5
|
||||||
|
Sue 370: trees: 0, children: 4, cars: 8
|
||||||
|
Sue 371: cats: 6, perfumes: 0, vizslas: 2
|
||||||
|
Sue 372: akitas: 7, cars: 5, perfumes: 3
|
||||||
|
Sue 373: cars: 0, perfumes: 4, pomeranians: 10
|
||||||
|
Sue 374: akitas: 5, perfumes: 5, vizslas: 2
|
||||||
|
Sue 375: goldfish: 7, trees: 10, pomeranians: 7
|
||||||
|
Sue 376: cars: 8, trees: 1, pomeranians: 8
|
||||||
|
Sue 377: cars: 0, akitas: 9, vizslas: 1
|
||||||
|
Sue 378: akitas: 5, perfumes: 3, vizslas: 7
|
||||||
|
Sue 379: trees: 2, goldfish: 8, pomeranians: 8
|
||||||
|
Sue 380: akitas: 5, cars: 9, perfumes: 9
|
||||||
|
Sue 381: cars: 2, perfumes: 6, trees: 3
|
||||||
|
Sue 382: perfumes: 6, vizslas: 2, goldfish: 9
|
||||||
|
Sue 383: akitas: 8, vizslas: 7, cats: 1
|
||||||
|
Sue 384: akitas: 9, trees: 10, vizslas: 7
|
||||||
|
Sue 385: cars: 0, perfumes: 7, vizslas: 2
|
||||||
|
Sue 386: vizslas: 10, akitas: 4, perfumes: 9
|
||||||
|
Sue 387: perfumes: 6, pomeranians: 5, samoyeds: 8
|
||||||
|
Sue 388: vizslas: 10, trees: 9, goldfish: 9
|
||||||
|
Sue 389: goldfish: 8, akitas: 4, perfumes: 10
|
||||||
|
Sue 390: goldfish: 6, trees: 8, akitas: 1
|
||||||
|
Sue 391: vizslas: 4, akitas: 10, goldfish: 7
|
||||||
|
Sue 392: akitas: 1, vizslas: 6, samoyeds: 5
|
||||||
|
Sue 393: trees: 6, cars: 3, akitas: 5
|
||||||
|
Sue 394: goldfish: 9, trees: 3, cars: 5
|
||||||
|
Sue 395: akitas: 6, samoyeds: 4, goldfish: 4
|
||||||
|
Sue 396: akitas: 2, trees: 1, cats: 5
|
||||||
|
Sue 397: cars: 0, children: 9, trees: 10
|
||||||
|
Sue 398: pomeranians: 3, samoyeds: 9, goldfish: 10
|
||||||
|
Sue 399: cars: 7, akitas: 4, goldfish: 8
|
||||||
|
Sue 400: cars: 4, akitas: 5, vizslas: 4
|
||||||
|
Sue 401: pomeranians: 5, akitas: 8, vizslas: 5
|
||||||
|
Sue 402: cats: 7, cars: 6, goldfish: 6
|
||||||
|
Sue 403: samoyeds: 8, perfumes: 4, cars: 5
|
||||||
|
Sue 404: akitas: 10, goldfish: 4, trees: 2
|
||||||
|
Sue 405: trees: 8, perfumes: 1, cars: 2
|
||||||
|
Sue 406: trees: 0, perfumes: 9, pomeranians: 10
|
||||||
|
Sue 407: perfumes: 4, trees: 7, goldfish: 3
|
||||||
|
Sue 408: akitas: 1, perfumes: 3, cars: 5
|
||||||
|
Sue 409: trees: 6, samoyeds: 3, cars: 9
|
||||||
|
Sue 410: vizslas: 3, goldfish: 5, akitas: 7
|
||||||
|
Sue 411: goldfish: 10, trees: 1, vizslas: 9
|
||||||
|
Sue 412: cars: 0, akitas: 6, trees: 6
|
||||||
|
Sue 413: goldfish: 7, trees: 0, cars: 3
|
||||||
|
Sue 414: pomeranians: 10, samoyeds: 3, cars: 10
|
||||||
|
Sue 415: perfumes: 6, trees: 9, cars: 4
|
||||||
|
Sue 416: trees: 2, cars: 4, goldfish: 8
|
||||||
|
Sue 417: goldfish: 2, cars: 9, cats: 5
|
||||||
|
Sue 418: vizslas: 1, cars: 9, akitas: 0
|
||||||
|
Sue 419: perfumes: 6, cats: 3, children: 9
|
||||||
|
Sue 420: cats: 5, goldfish: 7, akitas: 9
|
||||||
|
Sue 421: trees: 1, samoyeds: 6, pomeranians: 1
|
||||||
|
Sue 422: trees: 10, goldfish: 6, children: 7
|
||||||
|
Sue 423: cars: 8, goldfish: 7, vizslas: 3
|
||||||
|
Sue 424: samoyeds: 9, akitas: 7, trees: 5
|
||||||
|
Sue 425: akitas: 5, children: 4, perfumes: 9
|
||||||
|
Sue 426: goldfish: 1, children: 9, cats: 2
|
||||||
|
Sue 427: vizslas: 9, akitas: 7, goldfish: 9
|
||||||
|
Sue 428: pomeranians: 7, akitas: 5, vizslas: 1
|
||||||
|
Sue 429: vizslas: 7, goldfish: 7, cars: 9
|
||||||
|
Sue 430: trees: 7, perfumes: 0, pomeranians: 5
|
||||||
|
Sue 431: children: 9, perfumes: 5, vizslas: 7
|
||||||
|
Sue 432: trees: 6, samoyeds: 7, cats: 1
|
||||||
|
Sue 433: goldfish: 5, trees: 5, children: 6
|
||||||
|
Sue 434: goldfish: 9, akitas: 7, cars: 3
|
||||||
|
Sue 435: samoyeds: 10, perfumes: 2, cars: 0
|
||||||
|
Sue 436: akitas: 5, pomeranians: 4, perfumes: 7
|
||||||
|
Sue 437: vizslas: 5, cats: 6, perfumes: 5
|
||||||
|
Sue 438: trees: 2, goldfish: 6, vizslas: 7
|
||||||
|
Sue 439: samoyeds: 8, pomeranians: 10, goldfish: 1
|
||||||
|
Sue 440: akitas: 6, children: 9, perfumes: 4
|
||||||
|
Sue 441: cars: 2, goldfish: 9, children: 0
|
||||||
|
Sue 442: goldfish: 7, cars: 2, vizslas: 8
|
||||||
|
Sue 443: goldfish: 6, samoyeds: 3, perfumes: 2
|
||||||
|
Sue 444: trees: 2, goldfish: 7, cars: 8
|
||||||
|
Sue 445: trees: 2, pomeranians: 0, children: 0
|
||||||
|
Sue 446: perfumes: 4, akitas: 4, goldfish: 6
|
||||||
|
Sue 447: vizslas: 7, akitas: 9, cars: 3
|
||||||
|
Sue 448: goldfish: 6, trees: 9, cars: 0
|
||||||
|
Sue 449: samoyeds: 7, perfumes: 4, vizslas: 10
|
||||||
|
Sue 450: akitas: 7, cars: 10, goldfish: 7
|
||||||
|
Sue 451: goldfish: 4, children: 7, pomeranians: 4
|
||||||
|
Sue 452: cats: 4, vizslas: 6, trees: 7
|
||||||
|
Sue 453: cars: 1, trees: 10, goldfish: 9
|
||||||
|
Sue 454: trees: 2, goldfish: 3, vizslas: 10
|
||||||
|
Sue 455: pomeranians: 9, vizslas: 3, akitas: 2
|
||||||
|
Sue 456: vizslas: 10, akitas: 2, goldfish: 1
|
||||||
|
Sue 457: trees: 5, cats: 5, children: 8
|
||||||
|
Sue 458: cars: 6, goldfish: 3, akitas: 9
|
||||||
|
Sue 459: goldfish: 7, akitas: 2, cats: 7
|
||||||
|
Sue 460: akitas: 1, cars: 5, children: 8
|
||||||
|
Sue 461: cars: 8, perfumes: 0, goldfish: 6
|
||||||
|
Sue 462: pomeranians: 6, cats: 2, perfumes: 6
|
||||||
|
Sue 463: vizslas: 7, perfumes: 3, goldfish: 3
|
||||||
|
Sue 464: akitas: 10, goldfish: 10, trees: 1
|
||||||
|
Sue 465: vizslas: 0, akitas: 2, trees: 2
|
||||||
|
Sue 466: perfumes: 6, akitas: 8, cars: 2
|
||||||
|
Sue 467: goldfish: 1, cars: 10, perfumes: 3
|
||||||
|
Sue 468: goldfish: 4, trees: 2, cars: 9
|
||||||
|
Sue 469: perfumes: 6, pomeranians: 0, vizslas: 10
|
||||||
|
Sue 470: samoyeds: 8, children: 0, akitas: 7
|
||||||
|
Sue 471: children: 3, goldfish: 9, cats: 9
|
||||||
|
Sue 472: samoyeds: 0, goldfish: 0, trees: 0
|
||||||
|
Sue 473: trees: 3, goldfish: 4, vizslas: 1
|
||||||
|
Sue 474: perfumes: 10, cars: 3, trees: 7
|
||||||
|
Sue 475: akitas: 5, vizslas: 4, goldfish: 5
|
||||||
|
Sue 476: children: 2, akitas: 7, vizslas: 3
|
||||||
|
Sue 477: vizslas: 6, pomeranians: 9, trees: 6
|
||||||
|
Sue 478: vizslas: 7, pomeranians: 6, akitas: 7
|
||||||
|
Sue 479: trees: 2, perfumes: 2, children: 2
|
||||||
|
Sue 480: cars: 8, cats: 5, vizslas: 0
|
||||||
|
Sue 481: trees: 5, goldfish: 0, akitas: 3
|
||||||
|
Sue 482: cars: 8, perfumes: 6, goldfish: 10
|
||||||
|
Sue 483: goldfish: 0, cars: 3, perfumes: 10
|
||||||
|
Sue 484: pomeranians: 1, samoyeds: 1, perfumes: 3
|
||||||
|
Sue 485: trees: 0, akitas: 2, vizslas: 4
|
||||||
|
Sue 486: cars: 3, vizslas: 8, goldfish: 1
|
||||||
|
Sue 487: pomeranians: 9, vizslas: 2, children: 10
|
||||||
|
Sue 488: akitas: 6, vizslas: 10, perfumes: 9
|
||||||
|
Sue 489: goldfish: 6, vizslas: 4, cars: 2
|
||||||
|
Sue 490: vizslas: 10, cats: 8, samoyeds: 1
|
||||||
|
Sue 491: cats: 9, cars: 1, perfumes: 10
|
||||||
|
Sue 492: goldfish: 6, cars: 9, pomeranians: 9
|
||||||
|
Sue 493: children: 10, goldfish: 10, vizslas: 0
|
||||||
|
Sue 494: pomeranians: 5, cars: 0, vizslas: 0
|
||||||
|
Sue 495: vizslas: 7, perfumes: 6, samoyeds: 3
|
||||||
|
Sue 496: trees: 1, cats: 4, cars: 10
|
||||||
|
Sue 497: cats: 1, perfumes: 0, cars: 7
|
||||||
|
Sue 498: perfumes: 7, vizslas: 6, cats: 9
|
||||||
|
Sue 499: vizslas: 8, perfumes: 1, akitas: 3
|
||||||
|
Sue 500: perfumes: 4, cars: 9, trees: 4
|
@ -0,0 +1,20 @@
|
|||||||
|
43
|
||||||
|
3
|
||||||
|
4
|
||||||
|
10
|
||||||
|
21
|
||||||
|
44
|
||||||
|
4
|
||||||
|
6
|
||||||
|
47
|
||||||
|
41
|
||||||
|
34
|
||||||
|
17
|
||||||
|
17
|
||||||
|
44
|
||||||
|
36
|
||||||
|
31
|
||||||
|
46
|
||||||
|
9
|
||||||
|
27
|
||||||
|
38
|
@ -0,0 +1,100 @@
|
|||||||
|
###.##..##.#..#.##...#..#.####..#.##.##.##..###...#....#...###..#..###..###.#.#.#..#.##..#...##.#..#
|
||||||
|
.#...##.#####..##.......#..####.###.##.#..###.###.....#.#.####.##.###..##...###....#.##.....#.#.#.##
|
||||||
|
.....#.#.....#..###..####..#.....##.#..###.####.#.######..##......#####.#.##.#########.###..#.##.#.#
|
||||||
|
...###......#.#..###..#.#.....#.##..#.##..###...#.##.#..#..#.##.#..##......##.##.##.######...#....##
|
||||||
|
.###.....#...#.#...####.#.###..#..####.#..#.##..####...##.#...#..###...###...####..##....####.##..#.
|
||||||
|
..#....#...#.......#..###.###....#.##..#.....###.#.##.#....#.#....##.##..#.##.#..###.###.##.##..##.#
|
||||||
|
##..#####.#.#....#.#...#.#.####..#....#..#....#.#..#.#####...#..##.#.....#.##..##.####......#.#.##..
|
||||||
|
.#..##..#.#.###..##..##...#....##...#..#.#..##.##..###.####.....#.####.#.....##.#.##...#..####..#...
|
||||||
|
#.#####.......#####...#...####.#.#.#....#.###.#.##.#####..#.###.#..##.##.#.##....#.##..#....####.#.#
|
||||||
|
#.##...#####....##.#.#.....##......##.##...#.##.##...##...###.###.##.#.####.####.##..#.##.#.#.####..
|
||||||
|
#.##.##....###.###.#..#..##.##.#..#.#..##..#.#...#.##........###..#...##.#.#.##.......##.....#...###
|
||||||
|
###..#.#..##.##.#.#.#...#..#...##.##.#.########.......#.#...#....########..#.#.###..#.#..#.##..#####
|
||||||
|
####.#.#...#.##.##..#.#...#....#..###..#.#.#.####.#.##.##.#..##..##..#..#####.####.##..########..##.
|
||||||
|
.#.#...#..##.#..#..###.#..####.......##.#.#.#.##.#####..#..##...#.##...#..#....#..#..###..####.#....
|
||||||
|
..#.#...#....##...#####..#..#...###.###.....#.###.#....#.#..##...#.##.##.####.#.#.#..#.##.#....#.#..
|
||||||
|
#....###.####.##..#.#.###..###.##.##..#.#...###..#.##.#####.##.#######..#.#...##.#..........####.###
|
||||||
|
#.#####.#......#.#......#.....##...##.#.#########.#......##..##..##.#..##.##..#....##...###...#.#...
|
||||||
|
#..#..##..###.#.#.#.#.....###.#.####.##.##....#.#..##....#.#..#.####..###.##...#######.#####.##.#.#.
|
||||||
|
..###.#........##.#...###..#.##..#.#....##.#......#..#.##..#.#..#.#..#.####.#####..###.##..#.##.#...
|
||||||
|
##.###....#..##...#..#.#......##..#...#..#.####..#.##...##.####.#...#..###...#.#.#....###.##..#.#...
|
||||||
|
..##.##.#.##..##.#..#.###...##..##..#....##..##...####.#..####.###...#.....#..#.##..##..###..#.#...#
|
||||||
|
#.#....#.....#...##.#...####..#..##..##.####..##..##...####...#....##.#.#######..##.#......######.#.
|
||||||
|
#.#...###.######.######..##..##....#.#......#......#.#.##.#.##.#.#.#...#...#....#.#.#.#..#.##..#...#
|
||||||
|
####.###.#.#.##..#.##.#...#.##...#.##.##...#.....#.#..#.####.##..######.#..#.#..##....#.#.#..#.#.#.#
|
||||||
|
..##......#.#...#.##.##..##..##..#..##..#########.#..###..###.##...#..##.#..#.#.#.######..#....#.#..
|
||||||
|
..##.##.#...###.#...##..######.##.#..####..#..#.#.##.####.##.##.#...##....#...###.##.####..#....#.#.
|
||||||
|
####...###..#.#.##.#.#....###..##.#.#..########..#...#.#...#.##....##.##...#.....#.#.....#.....#....
|
||||||
|
.#.###############....#.##..###..#.####.#.##.##..#..#.#...###...##..##.##.#.....##...###.###.....#..
|
||||||
|
.###..#..##.##..####.#.###.##.##..#..##....#.#......#......##.#...#.#...#..##.#.#...#...#.##..#.##..
|
||||||
|
###.#.#.########.#.#..####.#..##.#.##.##.###.##..######...#..##.##.#..#.#...#.##..#####.....#.#.#..#
|
||||||
|
.##.##..#.#...#####.#.#.###...##...####...#......#...#..####..#.##..........#..#.#..###....######.##
|
||||||
|
..#####...#.#.#.#..#.##..#...#.#..#.##...##..##.##.#.##.#..#.#...#.......##.#...###.....#...#.#.#.##
|
||||||
|
##.##.#..######.##...#.....#.###.#..##.#.#.#..####.#....##.#....####...##....#.#.##.#..###.##.##..##
|
||||||
|
.###.##.#..#.###.####..#.##..####.#.#.##..###.#######.###.###...####........##....###.#...#.#.####.#
|
||||||
|
........#..#.#..##..########..........#.##.#..##.#...#.....####....##..#..#.#####.###...#...#.##.###
|
||||||
|
.....#..##.####...##.#####..######.##.#.###.####.##.##.#..##.##.######.##......#..#.####..##....#.##
|
||||||
|
##...####....#.##.##.###....#.#...#.####..##.#.##.#.#...####.#.#.#.#...##.###...##...###...######.##
|
||||||
|
.#....#.#.####...#.##.....##...###.#.#.##...##.#####....#.######.#.#....##..##...##....##.#.##.#.#.#
|
||||||
|
.###..###.#.......#.#######..#.#.#.######....#.#####.#.....#.#########...#....##...##.####.#..#.....
|
||||||
|
##.#..##..##.....#..##...#..##.##.#..#.#####.##.##.#.##.##...##.######.####..#.##..#####.##...##..#.
|
||||||
|
#.###...##.#.#.#.##....#.#.##.##..#....#...#.#.........#..#..####..####.####..#.##.##.#....####..##.
|
||||||
|
.#..######..#####.####.##.#.....#.#.#####..##..###.#.#.#..#.#...#.#######..##....##.##...#######..#.
|
||||||
|
#...#....#.#.##..#####..#########..#.....#...##.#.#.###...#####..##...##...####.......#######.#..###
|
||||||
|
.#......#...##.###..#....#...#.#.....#.#...##.#.#..#..###.##.###.#.##..##...#.##......#.###..#.#..##
|
||||||
|
.#....####...###..#.....##..#...#.#.###.#.#.##...#.##.##.#.#.#..####..###.#.#.#.##.#.#...#..#...####
|
||||||
|
......##.##.#...#####.##..#.###..#.#####..##.#..##.###......#...#...#..#......###.######...#.#.##..#
|
||||||
|
###..#...#.##..###.#....##...#..#####.#.#..#.###...#####.#....##..####.#.##...#.#...##..#.#.#.#..#.#
|
||||||
|
...##.#.##.##..#.#.#.###.#.#...#.....###.###.##...#.###.##...##..#..###.#..##.##..###.#....###..##..
|
||||||
|
.##.#..###..###.##.##...#..#####...#.....#####.##..####...#.##.#.#..##.#.#.#....###.....#....##.....
|
||||||
|
######.#..#.#..#....#.###...####.####.#.........#..##.#..##..##.....#..#.##.##...#...#####.#.##..#.#
|
||||||
|
.##.###...####....#.####...#####..#..#...#..#.....###.#..#.###..#.###.#.......##.####..#.##.#...##..
|
||||||
|
........#.#.##.#.....#####.###......##..#.##.#..#...####.#...#..###.#.#...##..#.#...#.####...#.#.###
|
||||||
|
.#..#.##..##...######.###.##.#.#...#.#.#.#.##..##..##.#.##..#....#.##...#.##.##...##....##.###.##.#.
|
||||||
|
##...#...#...###.#.#...#...#..###......##.#.#....##..##.#..##.#.######...#..##.#.##.#.#....#.##.##..
|
||||||
|
...#..###.#....#...#.##..##.#.##.#..###.##..#.##..####.#########....#.....##.#.##.##..##.##.######.#
|
||||||
|
#.##.#..##.......###...#.###....###.#..####..##.#####.##.###....##....#.###...####..#.#.#.##.....###
|
||||||
|
.......#...#...##.#...##.#.#..#.##..##.#....###...##.#####...#.........#.......###.##.#.#.###....##.
|
||||||
|
###.#.##.##.....#.#..#.#..####.####..#..###..........####.#.##...#######.###..#####..#.....#..###..#
|
||||||
|
#...##.##..####.##.###.#.#######..###.#..#######..#.##.####...#..#.##.####..####.#.#.......####.#...
|
||||||
|
...#.##..#..#..##........#.#..#..#.#....#.###.#.###..#.......###..#.....#....#..##.#...#.###...##.#.
|
||||||
|
###.##..#.##.#.#####..#.##.####....#####..###.#.#..#...#...###.#.##..#.#.#.....#.####.#.#.#.#.#.#...
|
||||||
|
..##..##..#..##.##.#...#..#....####....#...#..####..#.....######.###.####.#....##....##.#.#.###....#
|
||||||
|
.#.#.#.##..####..#.....#.####.#....#.....#....#.##..#.#..#.#...#.#.#.#..#..#..##.#....####.......#..
|
||||||
|
..##.##..###......#...#..##...#.###.####.#...#.####..#.#.#.....#.#...####...#.########.##.#.#.#..###
|
||||||
|
#....#.##.....##.###.##.###..#.####.....####.##...#..##.###...###..###.#....####.#..#..#..#.#..##.#.
|
||||||
|
.#.#.##....#.##......#.#..###.#....###....#......#.#.##.##.#########..##..#...#.####..#...####..#..#
|
||||||
|
.#.#.......##.#.##.#...#...#.##.#..#.#.#.##....#..###.###.##.#.#...##.#..#..##....#..###.#...#.#.##.
|
||||||
|
#.##.#....####...#..##..#.#.#.#.##.#...#####.#...#..#..#.####.####.#.#....#......##..##..###...#..##
|
||||||
|
..##.###..##.####..#..#..##...###.#.#.#######.####...####......##.##..#...#.##...##....#..#..#.....#
|
||||||
|
....#..#..#.#.####.#...##..#....####.#..####...#.#...###...#..#..##...#....##...#.....#.#..#.#.#...#
|
||||||
|
...#.#.#.##..##.###..#.######....####.###...##...###.#...##.####..#.#..#.#..#.##.....#.#.#..##......
|
||||||
|
.#.##.##.....##.#..###.###.##....#...###.#......#...##.###.#.##.##...###...###...#.######..#......#.
|
||||||
|
###..#...#......#..##...#....##.#..###.##.####..##..##....####.#...#.#....##..#.#######..#.#.#####..
|
||||||
|
##...#####..####..##....#.#.###.##.#..#.#..#.....###...###.#####.....#..##.#......#...#.###.##.##...
|
||||||
|
...#.#.#..#.###..#.#.#....##.#.#..####.##.#.####.#.#.#...#....##....#.##.####..###.#.#...##.#..#..##
|
||||||
|
#.#.#..#.##..##.##.#...##.#....#...###..##..#.#######.#.###..##......##.#..###.########.#.##..#.#.##
|
||||||
|
######.###....##..#..#...####....#.#.#..#...#..######.#.#.##..##....##....##.##.##...#..#.####.#.#..
|
||||||
|
#####.###..#..###......##...##.####.#.#.#.###.......##..##.####..##.####.#..#..####..#.####.#####...
|
||||||
|
##.#.#.###..##.#.##.#.#.#.##.#...##........###.#.##..####....###.#.####.####.#.......##.##.##...##..
|
||||||
|
#.#..###...#..##.....##.#..#.#..##..######.#####...###.#.......###...#..##..#..#..##.#.#....#..#..#.
|
||||||
|
#.#..####.###..#...#...#...#.###..#.#.#.#.#.#.#..#....#.##.##.##..###..####.#..##..##.###.###....##.
|
||||||
|
#..#.##.#####........#..#.##.#..##.#...#....#..#.##..###..##..##.##..#..##.#.#...#.#.##.#.##....#.#.
|
||||||
|
.......##..#.....#..#.#.....#.##...####.###..####..#.#.#.#..#.....#....##...#..#.##..###.#.#....#...
|
||||||
|
#...###########.##.....##...###.#.##.##..####.##...#.####.#####.#####.####...###.##...##..#.#.###..#
|
||||||
|
....#.#.###.####.###...#...#.#..###.#.#.##...#..#.#.#..#.####..#..###.######.#.####.###...###.#.##.#
|
||||||
|
.....#..#..########...#.#.#.#.#.#.#.#..###.##..####...##.#.#.#...##..#####.##.#...#.####.#######.##.
|
||||||
|
.......#...#.#..#..#...#..#..##.....#.##....##.##...##..##.##...##...#.#..#.##.#.###.#.####.#.#..##.
|
||||||
|
.####...#...#.#.#....##..........##.##.###.##.#.#..#.#.#......########.#...#.####.##.###..##...####.
|
||||||
|
#.#.#...##.###..##..#..#.....####.#.....##.##.#..#.#.###.#..#######...##..#.#..#.#..############.###
|
||||||
|
.##..####.#..#.....###..#..#.#.....#.#.#...##.##.#....#..#..###.#...#....#.#...####..#.....###.####.
|
||||||
|
..#...#.###.###....##.#..#.##..####.##.#.##.##.##...###.####..#.#.#.##.#.#.#..###..##.##.##.##.#..##
|
||||||
|
#...............##.....######.#.#####.##.#....#.#..#.##...#.##....#........##.##...#.##.##.#..#.##.#
|
||||||
|
#..##..#.#.#.##.#..#.#.##.##...#...#..#.#.##..#.#...###...##...###..#####.#.#..#..#.#..#.#.##...##.#
|
||||||
|
.#######.#.....##...#.#.####.######.#..#......#....##.#.#..#..###.#...###...#....#.#..#.##.#...#.#..
|
||||||
|
#.###......##.#.##..#.###.###..####..##....#..###......##..##..#####.####....#...###.....###.#..#...
|
||||||
|
###...#....###.#..#.###.##...###.##.......##.##.#.#.#....####....###..##.###...#..##....#.#.##..##..
|
||||||
|
.##.......##.######.#.#..#..##....#####.###.#.##.....####....#......####....#.##.#.##..#.##...##.#.#
|
||||||
|
.#.###...#.#.#.##.###..###...##..#.##.##..##..#.....###.#..#.##.##.####........##.#####.#.#....#...#
|
||||||
|
##...##..#.##.#######.###.#.##.#####....##.....##.#.....#.#.##.#....#.##.#....##.#..#.###..#..#.#...
|
||||||
|
.#..#.#.#.#...#.##...###.##.#.#...###.##...#.#..###....###.#.###...##..###..#..##.##....###...###.##
|
@ -0,0 +1,45 @@
|
|||||||
|
Al => ThF
|
||||||
|
Al => ThRnFAr
|
||||||
|
B => BCa
|
||||||
|
B => TiB
|
||||||
|
B => TiRnFAr
|
||||||
|
Ca => CaCa
|
||||||
|
Ca => PB
|
||||||
|
Ca => PRnFAr
|
||||||
|
Ca => SiRnFYFAr
|
||||||
|
Ca => SiRnMgAr
|
||||||
|
Ca => SiTh
|
||||||
|
F => CaF
|
||||||
|
F => PMg
|
||||||
|
F => SiAl
|
||||||
|
H => CRnAlAr
|
||||||
|
H => CRnFYFYFAr
|
||||||
|
H => CRnFYMgAr
|
||||||
|
H => CRnMgYFAr
|
||||||
|
H => HCa
|
||||||
|
H => NRnFYFAr
|
||||||
|
H => NRnMgAr
|
||||||
|
H => NTh
|
||||||
|
H => OB
|
||||||
|
H => ORnFAr
|
||||||
|
Mg => BF
|
||||||
|
Mg => TiMg
|
||||||
|
N => CRnFAr
|
||||||
|
N => HSi
|
||||||
|
O => CRnFYFAr
|
||||||
|
O => CRnMgAr
|
||||||
|
O => HP
|
||||||
|
O => NRnFAr
|
||||||
|
O => OTi
|
||||||
|
P => CaP
|
||||||
|
P => PTi
|
||||||
|
P => SiRnFAr
|
||||||
|
Si => CaSi
|
||||||
|
Th => ThCa
|
||||||
|
Ti => BP
|
||||||
|
Ti => TiTi
|
||||||
|
e => HF
|
||||||
|
e => NAl
|
||||||
|
e => OMg
|
||||||
|
|
||||||
|
ORnPBPMgArCaCaCaSiThCaCaSiThCaCaPBSiRnFArRnFArCaCaSiThCaCaSiThCaCaCaCaCaCaSiRnFYFArSiRnMgArCaSiRnPTiTiBFYPBFArSiRnCaSiRnTiRnFArSiAlArPTiBPTiRnCaSiAlArCaPTiTiBPMgYFArPTiRnFArSiRnCaCaFArRnCaFArCaSiRnSiRnMgArFYCaSiRnMgArCaCaSiThPRnFArPBCaSiRnMgArCaCaSiThCaSiRnTiMgArFArSiThSiThCaCaSiRnMgArCaCaSiRnFArTiBPTiRnCaSiAlArCaPTiRnFArPBPBCaCaSiThCaPBSiThPRnFArSiThCaSiThCaSiThCaPTiBSiRnFYFArCaCaPRnFArPBCaCaPBSiRnTiRnFArCaPRnFArSiRnCaCaCaSiThCaRnCaFArYCaSiRnFArBCaCaCaSiThFArPBFArCaSiRnFArRnCaCaCaFArSiRnFArTiRnPMgArF
|
@ -0,0 +1 @@
|
|||||||
|
36000000
|
@ -0,0 +1,72 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
|
||||||
|
@aoc-title[20]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket/day20]
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/20"]{The puzzle}. Our @link-rp["day20-input.txt"]{input} is a target number of presents, in this case @racket[36000000].
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day20>
|
||||||
|
<day20-setup>
|
||||||
|
<day20-q1>
|
||||||
|
<day20-q2>
|
||||||
|
<day20-test>]
|
||||||
|
|
||||||
|
@section{What's the first house that gets the target number of presents?}
|
||||||
|
|
||||||
|
We're asked to imagine infinite elves delivering presents to an infinite sequence of houses. (Already @link["http://practicaltypography.com/the-infinite-pixel-screen.html"]{I like} this puzzle.) The first elf delivers a present to every house equal to 10 times his number (= 10); the second elf, 20 gifts to every second house; the @italic{n}th elf, 10@italic{n} gifts to every @italic{n}th house.
|
||||||
|
|
||||||
|
Math jocks will notice that the elf behavior roughly describes a @link["https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes"]{Sieve of Eratosthenes}. Each house is visited by elf @italic{n} only if @italic{n} is a divisor of the house number. (Houses that are primes are therefore only visited by the first elf.) Might there be a Racket function that finds the divisors of a number? Why, yes — it's called @racket[divisors]. We can use it to find the numbers of the elves that visit a house, and loop through house numbers till we reach the target. (The 10-gift multiplier is arbitrary.)
|
||||||
|
|
||||||
|
@chunk[<day20-setup>
|
||||||
|
(require racket rackunit (only-in math divisors))
|
||||||
|
(provide (all-defined-out))
|
||||||
|
]
|
||||||
|
|
||||||
|
@chunk[<day20-q1>
|
||||||
|
|
||||||
|
(define (q1 input-str)
|
||||||
|
(define target-gifts (read (open-input-string input-str)))
|
||||||
|
(define gifts-per-elf 10)
|
||||||
|
(for/first ([house-number (in-naturals)]
|
||||||
|
#:when (let* ([elves (divisors house-number)]
|
||||||
|
[elf-gifts
|
||||||
|
(apply + (map (curry * gifts-per-elf) elves))])
|
||||||
|
(>= elf-gifts target-gifts)))
|
||||||
|
house-number))]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section{What's the first house that gets the target number of presents, if each elf delivers 11 gifts to 50 houses?}
|
||||||
|
|
||||||
|
Going with the math-jock vibe, what this condition means is that the highest-numbered house the @italic{n}th elf will visit is 50@italic{n}. So the answer for this question is like the first, but we'll @racket[filter] the list of elves using this condition.
|
||||||
|
|
||||||
|
@chunk[<day20-q2>
|
||||||
|
|
||||||
|
(define (q2 input-str)
|
||||||
|
(define target-gifts (read (open-input-string input-str)))
|
||||||
|
(define gifts-per-elf 11)
|
||||||
|
(for/first ([house-number (in-naturals)]
|
||||||
|
#:when (let* ([elves (divisors house-number)]
|
||||||
|
[elves (filter
|
||||||
|
(λ(e) (<= house-number (* 50 e))) elves)]
|
||||||
|
[elf-gifts
|
||||||
|
(apply + (map (curry * gifts-per-elf) elves))])
|
||||||
|
(>= elf-gifts target-gifts)))
|
||||||
|
house-number))
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section{Testing Day 20}
|
||||||
|
|
||||||
|
@chunk[<day20-test>
|
||||||
|
(module+ test
|
||||||
|
(define input-str (file->string "day20-input.txt"))
|
||||||
|
(check-equal? (q1 input-str) 831600)
|
||||||
|
(check-equal? (q2 input-str) 884520))]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
Hit Points: 109
|
||||||
|
Damage: 8
|
||||||
|
Armor: 2
|
@ -0,0 +1,2 @@
|
|||||||
|
Hit Points: 58
|
||||||
|
Damage: 9
|
@ -0,0 +1,18 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
|
||||||
|
@aoc-title[22]
|
||||||
|
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/22"]{The puzzle}. Our @link-rp["day22-input.txt"]{input} tells us our hit points and damage.
|
||||||
|
|
||||||
|
@chunk[<day22>
|
||||||
|
;;
|
||||||
|
]
|
||||||
|
|
||||||
|
@section{What's the least mana we can spend and win?}
|
||||||
|
|
||||||
|
Did I mention I hate RPGs? Well, this question is much more RPG-ish than @secref{Day_21}. It involves mana and spellscasting. So I'm taking a pass. If someone devises a concise solution, I'll be happy to add it to this page.
|
||||||
|
|
||||||
|
Otherwise, onward to @secref{Day_23}.
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
jio a, +19
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
jmp +23
|
||||||
|
tpl a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
inc a
|
||||||
|
tpl a
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
jio a, +8
|
||||||
|
inc b
|
||||||
|
jie a, +4
|
||||||
|
tpl a
|
||||||
|
inc a
|
||||||
|
jmp +2
|
||||||
|
hlf a
|
||||||
|
jmp -7
|
@ -0,0 +1,118 @@
|
|||||||
|
#lang scribble/lp2
|
||||||
|
@(require scribble/manual aoc-racket/helper)
|
||||||
|
|
||||||
|
@aoc-title[23]
|
||||||
|
|
||||||
|
@defmodule[aoc-racket/day23]
|
||||||
|
|
||||||
|
@link["http://adventofcode.com/day/23"]{The puzzle}. Our @link-rp["day23-input.txt"]{input} is a list of instructions representing a program for a two-register virtual machine.
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day23>
|
||||||
|
<day23-setup>
|
||||||
|
<day23-q1>
|
||||||
|
<day23-q2>
|
||||||
|
<day23-test>]
|
||||||
|
|
||||||
|
@section{What's the value in register @tt{b} after the program runs?}
|
||||||
|
|
||||||
|
The virtual machine has two registers, @tt{a} and @tt{b}, that both start at 0. It also has six instructions:
|
||||||
|
|
||||||
|
@itemlist[
|
||||||
|
|
||||||
|
@item{@tt{hlf r} sets register r to half its current value, then continues.}
|
||||||
|
@item{@tt{tpl r} sets register r to triple its current value, then continues.}
|
||||||
|
@item{@tt{inc r} adds 1 to register r, then continues.}
|
||||||
|
@item{@tt{jmp offset} jumps the instruction that is @tt{offset} steps away. An @tt{offset} can be positive or negative.}
|
||||||
|
@item{@tt{jie r, offset} is like @tt{jmp}, but only jumps if r is even.}
|
||||||
|
@item{@tt{jio r, offset} jumps by @tt{offset} if register r = 1.}
|
||||||
|
]
|
||||||
|
|
||||||
|
Although the virtual machine has the equivalent of functions & variables, the jump instructions add a complication. We can't just evaluate the instructions top to bottom. We have to maintain a list of all the instructions, and a pointer to where we are, so if we get a jump instruction, we can move to the right place.
|
||||||
|
|
||||||
|
Because we have to repeatedly update the values of the register, it'll be more convenient to use a hash table. Overall, the solution follows the general pattern of @secref{Day_7}.
|
||||||
|
|
||||||
|
Notice also that we're encasing the lines of the VM program in @racket[thunk*]. This creates a function wrapper around each instruction so that its evaluation is delayed until we explicitly ask for it. The @racket[inst] transformer turns the lines of the program into equivalent operations on our register hash table. All these functions return a number that indicates the offset of the next instruction (if it's not a jump instruction, then this value is just 1).
|
||||||
|
|
||||||
|
@chunk[<day23-setup>
|
||||||
|
(require racket rackunit
|
||||||
|
(for-syntax racket/file racket/string sugar/debug))
|
||||||
|
(provide (all-defined-out))
|
||||||
|
|
||||||
|
(define-syntax (convert-input-to-instruction-functions stx)
|
||||||
|
(syntax-case stx ()
|
||||||
|
[(_)
|
||||||
|
(let* ([input-strings (file->lines "day23-input.txt")]
|
||||||
|
[inst-strings (map (λ(str) (format "(thunk* (inst ~a))" (string-replace str "," ""))) input-strings)]
|
||||||
|
[inst-datums (map (compose1 read open-input-string) inst-strings)])
|
||||||
|
(datum->syntax stx `(define instructions (list ,@inst-datums))))]))
|
||||||
|
|
||||||
|
(define registers (make-hash '((a . 0)(b . 0))))
|
||||||
|
(define default-offset 1)
|
||||||
|
|
||||||
|
(define-syntax-rule (define-reg-updater id thunk)
|
||||||
|
(define (id reg)
|
||||||
|
(hash-update! registers reg thunk)
|
||||||
|
default-offset))
|
||||||
|
|
||||||
|
(define-reg-updater tpl (λ(val) (* 3 val)))
|
||||||
|
(define-reg-updater inc (λ(val) (add1 val)))
|
||||||
|
(define-reg-updater hlf (λ(val) (/ val 2)))
|
||||||
|
|
||||||
|
(define (jmpf reg num pred)
|
||||||
|
(if (pred (hash-ref registers reg)) num 1))
|
||||||
|
|
||||||
|
(define-syntax (inst stx)
|
||||||
|
(syntax-case stx (jmp jio jie)
|
||||||
|
[(_ jio reg num)
|
||||||
|
#'(jmpf 'reg num (curry = 1))]
|
||||||
|
[(_ jie reg num)
|
||||||
|
#'(jmpf 'reg num even?)]
|
||||||
|
[(_ jmp num)
|
||||||
|
#'num]
|
||||||
|
[(_ op reg)
|
||||||
|
#'(op 'reg)]))
|
||||||
|
|
||||||
|
(convert-input-to-instruction-functions)
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
With the instructions set up as functions, running the program is easy. We start at index 0 and evaluate the first instruction in our list (which will possibly update one of the registers). The result is the offset for the next instruction. We continue until our index exceeds the number of instructions available.
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day23-q1>
|
||||||
|
|
||||||
|
(define (q1)
|
||||||
|
(let eval-instruction ([idx 0])
|
||||||
|
(if (>= idx (length instructions))
|
||||||
|
(hash-ref registers 'b)
|
||||||
|
(let* ([inst (list-ref instructions idx)]
|
||||||
|
[jump-offset (inst)]
|
||||||
|
[next-idx (+ jump-offset idx)])
|
||||||
|
(eval-instruction next-idx)))))]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section{What's the value in register @tt{b} if register @tt{a} starts as 1?}
|
||||||
|
|
||||||
|
Same as the first question, except we'll reset the registers before running the program.
|
||||||
|
|
||||||
|
|
||||||
|
@chunk[<day23-q2>
|
||||||
|
|
||||||
|
(define (q2)
|
||||||
|
(hash-set*! registers 'a 1 'b 0)
|
||||||
|
(q1))
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@section{Testing Day 23}
|
||||||
|
|
||||||
|
@chunk[<day23-test>
|
||||||
|
(module+ test
|
||||||
|
(check-equal? (q1) 184)
|
||||||
|
(check-equal? (q2) 231))]
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
|||||||
|
1
|
||||||
|
3
|
||||||
|
5
|
||||||
|
11
|
||||||
|
13
|
||||||
|
17
|
||||||
|
19
|
||||||
|
23
|
||||||
|
29
|
||||||
|
31
|
||||||
|
37
|
||||||
|
41
|
||||||
|
43
|
||||||
|
47
|
||||||
|
53
|
||||||
|
59
|
||||||
|
67
|
||||||
|
71
|
||||||
|
73
|
||||||
|
79
|
||||||
|
83
|
||||||
|
89
|
||||||
|
97
|
||||||
|
101
|
||||||
|
103
|
||||||
|
107
|
||||||
|
109
|
||||||
|
113
|
@ -0,0 +1 @@
|
|||||||
|
To continue, please consult the code grid in the manual. Enter the code at row 2947, column 3029.
|
@ -0,0 +1,14 @@
|
|||||||
|
#lang at-exp racket/base
|
||||||
|
(require scribble/manual scribble/html-properties
|
||||||
|
scribble/core)
|
||||||
|
(provide (all-defined-out))
|
||||||
|
|
||||||
|
(define (aoc-title which)
|
||||||
|
(define which-str (number->string which))
|
||||||
|
(define day-x (format "day-~a" which-str))
|
||||||
|
(define day-prefix (format "~a-" day-x))
|
||||||
|
@title[#:style manual-doc-style]{Day @which-str})
|
||||||
|
|
||||||
|
(define (link-rp path . text-args)
|
||||||
|
(element (style #f (list (link-resource path)))
|
||||||
|
text-args))
|
@ -0,0 +1,6 @@
|
|||||||
|
#lang info
|
||||||
|
(define collection "aoc-racket")
|
||||||
|
(define scribblings '(("aoc-racket.scrbl" (multi-page))))
|
||||||
|
(define deps '("base" "scribble-lib" "sugar" "rackunit-lib" "math-lib"))
|
||||||
|
(define test-omit-paths (list #rx"rkt$"))
|
||||||
|
(define build-deps '("rackunit-lib" "racket-doc" "scribble-doc" "rackunit-doc" "at-exp-lib" "math-doc"))
|
Reference in New Issue