def test_inputToList(): assert inputToList(testData) == [ ["L", ".", "L", "L", ".", "L", "L", ".", "L", "L"], ["L", "L", "L", "L", "L", "L", "L", ".", "L", "L"], ["L", ".", "L", ".", "L", ".", ".", "L", ".", "."], ["L", "L", "L", "L", ".", "L", "L", ".", "L", "L"], ["L", ".", "L", "L", ".", "L", "L", ".", "L", "L"], ["L", ".", "L", "L", "L", "L", "L", ".", "L", "L"], [".", ".", "L", ".", "L", ".", ".", ".", ".", "."], ["L", "L", "L", "L", "L", "L", "L", "L", "L", "L"], ["L", ".", "L", "L", "L", "L", "L", "L", ".", "L"], ["L", ".", "L", "L", "L", "L", "L", ".", "L", "L"] ]
def test_stabilizeSeatsPart2(): assert countOccupied(stabilizeSeats(inputToList(testData), part2=True)) == 26
def test_checkFarSeat(): assert checkFarSeat(inputToList(testData2), 3, 4) == False
def test_stabilizeSeats(): assert countOccupied(stabilizeSeats(inputToList(testData))) == 37
def test_checkAllSeats(): assert checkAllSeats(inputToList(testData)) == inputToList(testOutput)
def test_checkSeat4(): assert checkSeat(inputToList(testData), 1, 0) == False
def test_checkSeat3(): assert checkSeat(inputToList(testData), 0, 0) == True
def test_checkSeat2(): assert checkSeat(inputToList(testData), 3, 2) == False
def test_checkSeat1(): assert checkSeat(inputToList(testData), 2, 3) == True
def test_day_11_2(): print( countOccupied( stabilizeSeats(inputToList(loadData("day11")), part2=True)))
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))))