def deal( self ): """Deals hands in random order.""" # shuffle a new deck of bones deck = list( self.deck ) * self.multiplier shuffle( deck ) # create and return the proper number of hands hands, handsize = [], self.handsize for i in range( self.handcount ): offset = i * handsize hands.append( tuple( sorted( bone() for bone in deck[ offset:offset + handsize ] ) ) ) else: return tuple( hands )
def shuffled_players( self ): """A list of players for this team in random order.""" players = list( self.players ) shuffle( players ) return players