import sys from bowling.game import BowlingGame if __name__ == '__main__': throwing = [] if len(sys.argv) > 1: throwing = [int(arg) for arg in sys.argv[1:]] print(BowlingGame.computeScore(throwing))
def test_compute_score(self): """ Tests if the score is computed correctly without frames on a typical game """ pins = [2, 3, 6, 4, 8, 1, 10, 3, 0, 10, 10, 10, 10, 1, 9, 5] self.assertEqual(BowlingGame.computeScore(pins), 164)
def test_score_empty_game(self): """ Tests if the score of an empty game is 0 """ self.assertEqual(BowlingGame.computeScoreOnFrames([]), 0) self.assertEqual(BowlingGame.computeScore([]), 0)
def test_compute_max_score(self): """ Tests if the maximum score is computed correctly without frames """ pins = [10 for _ in range(12)] self.assertEqual(BowlingGame.computeScore(pins), 300)