예제 #1
0
def day16to20():
    ## Day 16
    print("2015 Day 16 Part 1:", end=" ")
    print(Day16.part1("../inputs/16/input.txt"))
    print("2015 Day 16 Part 2:", end=" ")
    print(Day16.part2("../inputs/16/input.txt"))
    ## Day 17
    print("2015 Day 17 Part 1:", end=" ")
    print(Day17.part1("../inputs/17/input.txt"))
    print("2015 Day 17 Part 2:", end=" ")
    print(Day17.part2("../inputs/17/input.txt"))
    ## Day 18
    print("2015 Day 18 Part 1:", end=" ")
    print(Day18.part1("../inputs/18/input.txt"))
    print("2015 Day 18 Part 2:", end=" ")
    print(Day18.part2("../inputs/18/input.txt"))
    ## Day 19
    print("2015 Day 19 Part 1:", end=" ")
    print(Day19.part1("../inputs/19/input.txt"))
    print("2015 Day 19 Part 2:", end=" ")
    print(Day19.part2("../inputs/19/input.txt"))
    ## Day 20
    print("2015 Day 20 Part 1:", end=" ")
    print(Day20.part1("../inputs/20/input.txt"))
    print("2015 Day 20 Part 2:", end=" ")
    print(Day20.part2("../inputs/20/input.txt"))
예제 #2
0
파일: day25_test.py 프로젝트: besarism/aoc
 def test_part2(self):
     print(
         "Day 19 Part 2: This test is slow, comment out for a faster feedback loop"
     )
     program = parse("../../19/input.txt")
     d19 = Day19(program)
     got = d19.part2()
     want = 15641348
     self.assertEqual(got, want)
예제 #3
0
def test_part_2():
    assert Day19.part2_result(test_input) == 0, "failed day19 part II"
예제 #4
0
def test_part_1():
    assert Day19.part1_result(test_input) == 0, "failed day19 part I"
예제 #5
0
파일: day25_test.py 프로젝트: besarism/aoc
 def test_part1(self):
     program = parse("../../19/input.txt")
     d19 = Day19(program)
     got = d19.part1()
     want = 141
     self.assertEqual(got, want)
예제 #6
0
파일: day19.py 프로젝트: besarism/aoc
#!/usr/bin/env python

from collections import defaultdict
from aoc.computer import Computer, solve1
from aoc.day19 import Day19


def parse(filename):
    with open(filename) as f:
        return [int(num) for num in f.readline().strip().split(",")]


if __name__ == "__main__":
    program = parse("../../19/input.txt")
    d9 = Day19(program)
    print("Part1")
    print(d9.part1())
    print("Part2")
    print(d9.part2())