Example #1
0
    def __init__(self):
        """
        Initialise the game state.
        Always have 2 players

        """
        GameState.__init__(self)
        self.player_to_move = 0
        self.player_hands = [[],[]]
        self.discards = []
        self.on_the_table = []
        self.combo_size = 0
        self.consecutive_mode = 0
        self.straight_length = 0
Example #2
0
 def __init__(self, n):
     """ Initialise the game state. n is the number of players (from 2 to 7).
         """
     GameState.__init__(self)
     self.number_of_players = n
     self.player_to_move = 1
     self.tricks_in_round = 7
     self.player_hands = {p: [] for p in xrange(1, self.number_of_players + 1)}
     self.discards = []
     self.current_trick = []
     self.trump_suit = None
     self.tricks_taken = {}
     self.knocked_out = {p: False for p in
                        xrange(1, self.number_of_players + 1)}
     self._deal()