예제 #1
0
def test_stabilizeSeatsPart2():
    assert countOccupied(stabilizeSeats(inputToList(testData),
                                        part2=True)) == 26
예제 #2
0
def test_day_11_2():
    print(
        countOccupied(
            stabilizeSeats(inputToList(loadData("day11")), part2=True)))
예제 #3
0
def test_stabilizeSeats():
    assert countOccupied(stabilizeSeats(inputToList(testData))) == 37
예제 #4
0
      str(sumUnanimousAnswers(loadData("day6", splitChar="\n\n"))))

from day7.day7 import countBags, generateRules, bagsInBags
print("day 7 part 1 = " +
      str(countBags(generateRules(loadData("day7")), "shiny gold")))
print("day 7 part 1 = " +
      str(bagsInBags(generateRules(loadData("day7")), "shiny gold")))

from day8.day8 import runInfiniteProgram, instructionList, fixProgram
print("day 8 part 1 = " +
      str(runInfiniteProgram(instructionList(loadData("day8")))))
print("day 8 part 2 = " + str(fixProgram(instructionList(loadData("day8")))))

from day9.day9 import findIncorrectNum, findValFromRange
print("day 9 part 1 = " +
      str(findIncorrectNum(loadData("day9", parseInt=True), 25)))
print("day 9 part 2 = " + str(
    findValFromRange(loadData("day9", parseInt=True),
                     findIncorrectNum(loadData("day9", parseInt=True), 25))))

from day10.day10 import calculateJoltage, calculateDistinctJoltages
print("day 10 part 1 = " +
      str(calculateJoltage(loadData("day10", parseInt=True))))
print("day 10 part 2 = " +
      str(calculateDistinctJoltages(loadData("day10", parseInt=True))))

from day11.day11 import inputToList, countOccupied, stabilizeSeats
print("day 11 part 1 = " +
      str(countOccupied(stabilizeSeats(inputToList(loadData("day11"))))))
print("day 11 part 2 = " + str(
    countOccupied(stabilizeSeats(inputToList(loadData("day11")), part2=True))))