Пример #1
0
 def test_winScore_fTest(self):
     game = bingo.Game(self.fTest)
     winStats, loseStats = game.playSequence()
     self.assertEqual(4512, winStats[2])
Пример #2
0
"""
https://adventofcode.com/2021/day/4
"""
from bingo import bingo

# import logging
# import sys

if __name__ == '__main__':
    # logging.basicConfig(filename="../log/2021_d04.log", encoding='utf-8', level=logging.WARNING)
    fInput = "input2021_04a.txt"
    game = bingo.Game(fInput)
    win, lose = game.playSequence()
    print("Winner: card {} in {} moves with a final score of {}.".format(*win))
    print("Loser: card {} in {} moves with a final score of {}.".format(*lose))
Пример #3
0
 def test_winner_fTest(self):
     game = bingo.Game(self.fTest)
     winStats, loseStats = game.playSequence()
     self.assertEqual(2, winStats[0])
Пример #4
0
 def test_winScore_fInput(self):
     game = bingo.Game(self.fInput)
     winStats, loseStats = game.playSequence()
     self.assertEqual(74320, winStats[2])
Пример #5
0
 def test_loser_fInput(self):
     game = bingo.Game(self.fInput)
     winStats, loseStats = game.playSequence()
     self.assertEqual(28, loseStats[0])
Пример #6
0
 def test_winMoveCount_fTest(self):
     game = bingo.Game(self.fTest)
     winStats, loseStats = game.playSequence()
     self.assertEqual(12, winStats[1])
Пример #7
0
 def test_sequenceMaximum_fTest(self):
     game = bingo.Game(self.fTest)
     self.assertEqual(26, max([int(x) for x in game.sequence]))
Пример #8
0
 def test_loseMoveCount_fInput(self):
     game = bingo.Game(self.fInput)
     winStats, loseStats = game.playSequence()
     self.assertEqual(88, loseStats[1])
Пример #9
0
 def test_sequenceMaximum_fInput(self):
     game = bingo.Game(self.fInput)
     self.assertEqual(99, max([int(x) for x in game.sequence]))
Пример #10
0
 def test_sequenceLength_fTest(self):
     game = bingo.Game(self.fTest)
     self.assertEqual(27, len(game.sequence))
Пример #11
0
 def test_sequenceLength_fInput(self):
     game = bingo.Game(self.fInput)
     self.assertEqual(100, len(game.sequence))
Пример #12
0
 def test_cardCount_fTest(self):
     game = bingo.Game(self.fTest)
     self.assertEqual(3, len(game.cards))
Пример #13
0
 def test_cardCount_fInput(self):
     game = bingo.Game(self.fInput)
     self.assertEqual(100, len(game.cards))