示例#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()
示例#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()
示例#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)
示例#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)