Esempio n. 1
0
 def pick_low_num_for_streak(self):
     greedyAgent = GreedyAgent("greedy")
     greedyAgent.cards = [(2, "Fire"), (3, "Ice"), (4, "Water")]
     greedyAgent.pickCard()
     greedyAgent.accumulatedCards["Water"] += 1
     greedyAgent.cards.append((1, "Water"))
     greedyAgent.cards.append((0, "Water"))
     greedyAgent.pickCard()
     self.assertEqual(greedyAgent.playedCard, (1, "Water"))
     greedyAgent.accumulatedCards["Water"] += 1
     greedyAgent.pickCard()
     self.assertEqual(greedyAgent.playedCard, (0, "Water"))
Esempio n. 2
0
 def pick_highest_num_test(self):
     greedyAgent = GreedyAgent("greedy")
     greedyAgent.cards = [(2, "Fire"), (3, "Ice"), (4, "Water")]
     greedyAgent.pickCard()
     self.assertEqual(greedyAgent.playedCard, (4, "Water"))