Beispiel #1
0
 def test_solvesolveEquationAdditionPrecedent_with_high_complexity(self):
     solver = AoC()
     result = solver.solveEquationAdditionPrecedent("((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2")
     self.assertEqual(23340, result)
Beispiel #2
0
 def test_solvesolveEquationAdditionPrecedent_with_parentheses_4(self):
     solver = AoC()
     result = solver.solveEquationAdditionPrecedent("5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4))")
     self.assertEqual(669060, result)
Beispiel #3
0
 def test_solvesolveEquationAdditionPrecedent_with_parentheses_3(self):
     solver = AoC()
     result = solver.solveEquationAdditionPrecedent("5 + (8 * 3 + 9 + 3 * 4 * 3)")
     self.assertEqual(1445, result)
Beispiel #4
0
 def test_solvesolveEquationAdditionPrecedent_with_parentheses_2(self):
     solver = AoC()
     result = solver.solveEquationAdditionPrecedent("2 * 3 + (4 * 5)")
     self.assertEqual(46, result)
Beispiel #5
0
 def test_solvesolveEquationAdditionPrecedent_with_parentheses(self):
     solver = AoC()
     result = solver.solveEquationAdditionPrecedent("1 + (2 * 3) + (4 * (5 + 6))")
     self.assertEqual(51, result)
Beispiel #6
0
 def test_solveEquationAdditionPrecedent(self):
     solver = AoC()
     result = solver.solveEquationAdditionPrecedent("1 + 2 * 3 + 4 * 5 + 6")
     self.assertEqual(231, result)