Exemplo n.º 1
0
 def test_auto_bake(self):
     ingredients = [
         "Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8",
         "Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3"
     ]
     solver = SolutionFifteen(ingredients)
     cookie = solver.bake()
     self.assertEqual(62842880, cookie.score)
Exemplo n.º 2
0
 def test_auto_bake(self):
     ingredients = [
         "Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8",
         "Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3",
     ]
     solver = SolutionFifteen(ingredients)
     cookie = solver.bake()
     self.assertEqual(62842880, cookie.score)
Exemplo n.º 3
0
from SolutionFifteen import SolutionFifteen

ingredient_descriptions = [
    "Frosting: capacity 4, durability -2, flavor 0, texture 0, calories 5",
    "Candy: capacity 0, durability 5, flavor -1, texture 0, calories 8",
    "Butterscotch: capacity -1, durability 0, flavor 5, texture 0, calories 6",
    "Sugar: capacity 0, durability 0, flavor -2, texture 2, calories 1"
]
solver = SolutionFifteen(ingredient_descriptions)
cookie = solver.bake()
print "*********************"
print " Winning cookie: %s" % cookie
print "  Score: %d" % cookie.score
print "*********************"
Exemplo n.º 4
0
from SolutionFifteen import SolutionFifteen


ingredient_descriptions = [
    "Frosting: capacity 4, durability -2, flavor 0, texture 0, calories 5",
    "Candy: capacity 0, durability 5, flavor -1, texture 0, calories 8",
    "Butterscotch: capacity -1, durability 0, flavor 5, texture 0, calories 6",
    "Sugar: capacity 0, durability 0, flavor -2, texture 2, calories 1"
]
solver = SolutionFifteen(ingredient_descriptions)
cookie = solver.bake()
print "*********************"
print " Winning cookie: %s" % cookie
print "  Score: %d" % cookie.score
print "*********************"