Esempio n. 1
0
 def __init__(self, which):
     self.players = ['stupid', 'smart']
     self.player_name = which
     if not (which in self.players):
         print "player %s not found" % which
         exit(1)
     self.hand_rules = HandRules()
Esempio n. 2
0
 def __init__(self, which):
     self.players = ['stupid', 'smart']
     self.player_name = which
     if not (which in self.players):
         print "player %s not found" % which
         exit(1)
     self.hand_rules = HandRules()
Esempio n. 3
0
class Player(object):

    def __init__(self, which):
        self.players = ['stupid', 'smart']
        self.player_name = which
        if not (which in self.players):
            print "player %s not found" % which
            exit(1)
        self.hand_rules = HandRules()

    def this_hand(self, last_hand):

        if self.player_name == self.players[0]:
            list = [self.hand_rules.hand_win(last_hand), self.hand_rules.hand_win(last_hand), last_hand]
        else:
            list = [self.hand_rules.hand_lose(last_hand), self.hand_rules.hand_lose(last_hand), self.hand_rules.hand_win(last_hand), last_hand]
        return choice(list)
Esempio n. 4
0
class Player(object):
    def __init__(self, which):
        self.players = ['stupid', 'smart']
        self.player_name = which
        if not (which in self.players):
            print "player %s not found" % which
            exit(1)
        self.hand_rules = HandRules()

    def this_hand(self, last_hand):

        if self.player_name == self.players[0]:
            list = [
                self.hand_rules.hand_win(last_hand),
                self.hand_rules.hand_win(last_hand), last_hand
            ]
        else:
            list = [
                self.hand_rules.hand_lose(last_hand),
                self.hand_rules.hand_lose(last_hand),
                self.hand_rules.hand_win(last_hand), last_hand
            ]
        return choice(list)