def test(): aoc.test_subject(solve) aoc.test(""" .#. ..# ### """) == 112
def test(): aoc.test_subject(solve) aoc.test(""" 1-3 a: abcde 1-3 b: cdefg 2-9 c: ccccccccc """) == 1
def test(): aoc.test_subject(solve) aoc.test('1 + 2 * 3 + 4 * 5 + 6') == 71 aoc.test('2 * 3 + (4 * 5)') == 26 aoc.test('5 + (8 * 3 + 9 + 3 * 4 * 3)') == 437 aoc.test('5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))') == 12240 aoc.test('((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2') == 13632
def test(): aoc.test_subject(solve) aoc.test(""" 5764801 17807724 """) == 14897079
def test(): aoc.test_subject(solve) aoc.test('nwwswee') == 1 aoc.test(""" sesenwnenenewseeswwswswwnenewsewsw neeenesenwnwwswnenewnwwsewnenwseswesw seswneswswsenwwnwse nwnwneseeswswnenewneswwnewseswneseene swweswneswnenwsewnwneneseenw eesenwseswswnenwswnwnwsewwnwsene sewnenenenesenwsewnenwwwse wenwwweseeeweswwwnwwe wsweesenenewnwwnwsenewsenwwsesesenwne neeswseenwwswnwswswnw nenwswwsewswnenenewsenwsenwnesesenew enewnwewneswsewnwswenweswnenwsenwsw sweneswneswneneenwnewenewwneswswnese swwesenesewenwneswnwwneseswwne enesenwswwswneneswsenwnewswseenwsese wnwnesenesenenwwnenwsewesewsesesew nenewswnwewswnenesenwnesewesw eneswnwswnwsenenwnwnwwseeswneewsenese neswnwewnwnwseenwseesewsenwsweewe wseweeenwnesenwwwswnew """) == 10
def test(): aoc.test_subject(solve) aoc.test(""" 35 20 15 25 47 40 62 55 65 95 102 117 150 182 127 219 299 277 309 576 """, n=5) == 62
def test(): aoc.test_subject(solve) aoc.test(""" mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X mem[8] = 11 mem[7] = 101 mem[8] = 0 """) == 165
def test(): aoc.test_subject(solve) aoc.test(""" mask = 000000000000000000000000000000X1001X mem[42] = 100 mask = 00000000000000000000000000000000X0XX mem[26] = 1 """) == 208
def test(): aoc.test_subject(solve) aoc.test(""" mxmxvkd kfcds sqjhc nhms (contains dairy, fish) trh fvjkl sbzzf mxmxvkd (contains dairy) sqjhc fvjkl (contains soy) sqjhc mxmxvkd sbzzf (contains fish) """) == 'mxmxvkd,sqjhc,fvjkl'
def test(): aoc.test_subject(solve) aoc.test(''' 1721 979 366 299 675 1456 ''') == 241861950
def test(): aoc.test_subject(solve) aoc.test(""" F10 N3 F7 R90 F11 """) == 286
def test(): aoc.test_subject(solve) aoc.test(""" nop +0 acc +1 jmp +4 acc +3 jmp -3 acc -99 acc +1 jmp -4 acc +6 """) == 5
def test(): aoc.test_subject(solve) aoc.test(""" light red bags contain 1 bright white bag, 2 muted yellow bags. dark orange bags contain 3 bright white bags, 4 muted yellow bags. bright white bags contain 1 shiny gold bag. muted yellow bags contain 2 shiny gold bags, 9 faded blue bags. shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags. dark olive bags contain 3 faded blue bags, 4 dotted black bags. vibrant plum bags contain 5 faded blue bags, 6 dotted black bags. faded blue bags contain no other bags. dotted black bags contain no other bags. """) == 4
def test(): aoc.test_subject(solve) aoc.test(""" 42: 9 14 | 10 1 9: 14 27 | 1 26 10: 23 14 | 28 1 1: "a" 11: 42 31 5: 1 14 | 15 1 19: 14 1 | 14 14 12: 24 14 | 19 1 16: 15 1 | 14 14 31: 14 17 | 1 13 6: 14 14 | 1 14 2: 1 24 | 14 4 0: 8 11 13: 14 3 | 1 12 15: 1 | 14 17: 14 2 | 1 7 23: 25 1 | 22 14 28: 16 1 4: 1 1 20: 14 14 | 1 15 3: 5 14 | 16 1 27: 1 6 | 14 18 14: "b" 21: 14 1 | 1 14 25: 1 1 | 1 14 22: 14 14 8: 42 26: 14 22 | 1 20 18: 15 15 7: 14 5 | 1 21 24: 14 1 abbbbbabbbaaaababbaabbbbabababbbabbbbbbabaaaa bbabbbbaabaabba babbbbaabbbbbabbbbbbaabaaabaaa aaabbbbbbaaaabaababaabababbabaaabbababababaaa bbbbbbbaaaabbbbaaabbabaaa bbbababbbbaaaaaaaabbababaaababaabab ababaaaaaabaaab ababaaaaabbbaba baabbaaaabbaaaababbaababb abbbbabbbbaaaababbbbbbaaaababb aaaaabbaabaaaaababaa aaaabbaaaabbaaa aaaabbaabbaaaaaaabbbabbbaaabbaabaaa babaaabbbaaabaababbaabababaaab aabbbbbaabbbaaaaaabbbbbababaaaaabbaaabba """) == 12
def test(): aoc.test_subject(solve) aoc.test(""" L.LL.LL.LL LLLLLLL.LL L.L.L..L.. LLLL.LL.LL L.LL.LL.LL L.LLLLL.LL ..L.L..... LLLLLLLLLL L.LLLLLL.L L.LLLLL.LL """) == 37
def test(): aoc.test_subject(solve) aoc.test(""" 16 10 15 5 1 11 7 19 6 12 4 """) == 8 aoc.test(""" 28 33 18 42 31 14 46 20 48 47 24 23 49 45 19 38 39 11 1 32 25 35 8 17 7 9 4 2 34 10 3 """) == 19208
def test(): aoc.test_subject(solve) aoc.test(""" ..##....... #...#...#.. .#....#..#. ..#.#...#.# .#...##..#. ..#.##..... .#.#.#....# .#........# #.##...#... #...##....# .#..#...#.# """) == 336
def test(): aoc.test_subject(solve) aoc.test(""" 0: 4 1 5 1: 2 3 | 3 2 2: 4 4 | 5 5 3: 4 5 | 5 4 4: "a" 5: "b" ababbb bababa abbbab aaabbb aaaabbb """) == 2
def test(): aoc.test_subject(solve) aoc.test(""" class: 1-3 or 5-7 row: 6-11 or 33-44 seat: 13-40 or 45-50 your ticket: 7,1,14 nearby tickets: 7,3,47 40,4,50 55,2,20 38,6,12 """) == 71
def test(): aoc.test_subject(solve) aoc.test(""" ecl:gry pid:860033327 eyr:2020 hcl:#fffffd byr:1937 iyr:2017 cid:147 hgt:183cm iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 hcl:#cfa07d byr:1929 hcl:#ae17e1 iyr:2013 eyr:2024 ecl:brn pid:760753108 byr:1931 hgt:179cm hcl:#cfa07d eyr:2025 pid:166559648 iyr:2011 ecl:brn hgt:59in """) == 2
def test(): aoc.test_subject(solve) aoc.test(""" Player 1: 9 2 6 3 1 Player 2: 5 8 4 7 10 """) == 291
def test(): aoc.test_subject(solve) aoc.test(""" abc a b c ab ac a a a a b """) == 11
def test(): aoc.test_subject(solve) aoc.test('0,3,6') == 175594 aoc.test('1,3,2') == 2578 aoc.test('2,1,3') == 3544142 aoc.test('1,2,3') == 261214 aoc.test('2,3,1') == 6895259 aoc.test('3,2,1') == 18 aoc.test('3,1,2') == 362
def test(): aoc.test_subject(solve) aoc.test(""" Tile 2311: ..##.#..#. ##..#..... #...##..#. ####.#...# ##.##.###. ##...#.### .#.#.#..## ..#....#.. ###...#.#. ..###..### Tile 1951: #.##...##. #.####...# .....#..## #...###### .##.#....# .###.##### ###.##.##. .###....#. ..#.#..#.# #...##.#.. Tile 1171: ####...##. #..##.#..# ##.#..#.#. .###.####. ..###.#### .##....##. .#...####. #.##.####. ####..#... .....##... Tile 1427: ###.##.#.. .#..#.##.. .#.##.#..# #.#.#.##.# ....#...## ...##..##. ...#.##### .#.####.#. ..#..###.# ..##.#..#. Tile 1489: ##.#.#.... ..##...#.. .##..##... ..#...#... #####...#. #..#.#.#.# ...#.#.#.. ##.#...##. ..##.##.## ###.##.#.. Tile 2473: #....####. #..#.##... #.##..#... ######.#.# .#...#.#.# .######### .###.#..#. ########.# ##...##.#. ..###.#.#. Tile 2971: ..#.#....# #...###... #.#.###... ##.##..#.. .#####..## .#..####.# #..#.#..#. ..####.### ..#.#.###. ...#.#.#.# Tile 2729: ...#.#.#.# ####.#.... ..#.#..... ....#..#.# .##..##.#. .#.####... ####.#.#.. ##.####... ##..#.##.. #.##...##. Tile 3079: #.#.#####. .#..###### ..#....... ######.... ####.#..#. .#...#.##. #.#####.## ..#.###... ..#....... ..#.###... """) == 20899048083289
def test(): aoc.test_subject(solve) aoc.test(""" 0 17,x,13,19 """) == 3417 aoc.test(""" 0 67,7,59,61 """) == 754018 aoc.test(""" 0 67,x,7,59,61 """) == 779210 aoc.test(""" 0 67,7,x,59,61 """) == 1261476 aoc.test(""" 0 1789,37,47,1889 """) == 1202161486 aoc.test(""" 939 7,13,x,x,59,x,31,19 """) == 1068781
def test(): aoc.test_subject(solve) aoc.test(""" acc +8 """) == 8
def test(): aoc.test_subject(solve) aoc.test('0,3,6') == 436 aoc.test('1,3,2') == 1 aoc.test('2,1,3') == 10 aoc.test('1,2,3') == 27 aoc.test('2,3,1') == 78 aoc.test('3,2,1') == 438 aoc.test('3,1,2') == 1836
def test(): aoc.test_subject(solve) aoc.test('1 + 2 * 3 + 4 * 5 + 6') == 231 aoc.test('1 + (2 * 3) + (4 * (5 + 6))') == 51 aoc.test('2 * 3 + (4 * 5)') == 46 aoc.test('5 + (8 * 3 + 9 + 3 * 4 * 3)') == 1445 aoc.test('5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))') == 669060 aoc.test('((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2') == 23340
def test(): aoc.test_subject(seatid) aoc.test('FBFBBFFRLR') == 357 aoc.test_subject(encode_seat) aoc.test(357) == 'FBFBBFFRLR'
def test(): aoc.test_subject(solve) aoc.test(""" 3 2 1 """) == 6