*REAL* Python has no dict comprehensions.
[naja.git] / naja / gameboard.py
index 7d9dfafe1c44b30b160da7d1ba276858ebfa5504..66c651936099520c0d163786881b7422974fac94 100644 (file)
@@ -56,6 +56,8 @@ class GameBoard(object):
         if wins_required is None:
             wins_required = defaults['wins_required']
 
+        assert wins_required + max_health == 8
+
         # Overriden by command line
         if options.initial_bits:
             initial_bits = options.initial_bits
@@ -186,7 +188,7 @@ class GameBoard(object):
         # Find which cards are at their maximum and exclude them from
         # the choice list
         counts = {}
-        choices = {card['card_name']: card for card in cards}
+        choices = dict((card['card_name'], card) for card in cards)
         for pos, card in board_locations:
             if pos == position:
                 # skip the card we're replacing if appropriate
@@ -303,6 +305,9 @@ class LocationCard(object):
         self.actions = location_actions
         self.max_number = max_number
         self.replacement_time = replacement_time
+        if options.debug:
+            for action in self.actions:
+                action.sanity_check(self)
 
     @classmethod
     def import_location(cls, state):