예제 #1
0
파일: agent.py 프로젝트: smnguyen/ml-durak
    def getAttackCard(self, cards, game):
        self.printInfo(game)
        if cards[-1] != dk.Durak.END_ROUND:
            print 'Your options: ', cards
            index = util.readIntegerInRange(0, len(cards),
                                            'Select a card to begin attack: ')
        else:
            cards.remove(dk.Durak.END_ROUND)
            print 'Your options: ', cards
            index = util.readIntegerInRange(-1, len(cards) - 1,
                                            'Select a card to attack (-1 to stop): ')

        if index == -1:
            return dk.Durak.END_ROUND
        else:
            return cards[index]
예제 #2
0
파일: agent.py 프로젝트: kglnsk/ml-durak
    def getAttackCard(self, cards, game):
        self.printInfo(game)
        if cards[-1] != dk.Durak.END_ROUND:
            print(('Your options: ', cards))
            index = util.readIntegerInRange(0, len(cards),
                                            'Select a card to begin attack: ')
        else:
            cards.remove(dk.Durak.END_ROUND)
            print(('Your options: ', cards))
            index = util.readIntegerInRange(-1, len(cards) - 1,
                                            'Select a card to attack (-1 to stop): ')

        if index == -1:
            return dk.Durak.END_ROUND
        else:
            return cards[index]
예제 #3
0
파일: agent.py 프로젝트: smnguyen/ml-durak
 def getDefendCard(self, cards, game):
     self.printInfo(game)
     print 'Your options: ', cards
     index = util.readIntegerInRange(-1, len(cards) - 1,
                                     'Select a card to defend (-1 to surrender): ')
     if index == -1:
         return dk.Durak.END_ROUND
     else:
         return cards[index]
예제 #4
0
파일: agent.py 프로젝트: kglnsk/ml-durak
 def getDefendCard(self, cards, game):
     self.printInfo(game)
     print(('Your options: ', cards))
     index = util.readIntegerInRange(-1, len(cards) - 1,
                                     'Select a card to defend (-1 to surrender): ')
     if index == -1:
         return dk.Durak.END_ROUND
     else:
         return cards[index]
예제 #5
0
 def chooseDefenseCard(self, options, table, trumpCard, deckSize,
                       opponentHandSize, trashCards):
     print "  Defending options: ", options
     return util.readIntegerInRange(
         -1, len(options),
         "  Select a card, %s (-1 to surrender): " % self.name)
예제 #6
0
 def chooseAttackCard(self, options, table, trumpCard, deckSize,
                      opponentHandSize, trashCards):
     print "  Attacking options: ", options
     return util.readIntegerInRange(
         -1, len(options),
         "  Select a card, %s (-1 to stop attack): " % self.name)
예제 #7
0
 def beginAttack(self, trumpCard, deckSize, opponentHandSize, trashCards):
     return util.readIntegerInRange(
         0, len(self.hand),
         "  Select a card to begin attack, %s: " % self.name)
예제 #8
0
파일: player.py 프로젝트: smnguyen/ml-durak
 def chooseDefenseCard(self, options, table, trumpCard, deckSize, opponentHandSize, trashCards):
     print "  Defending options: ", options
     return util.readIntegerInRange(-1, len(options),
                                    "  Select a card, %s (-1 to surrender): " % self.name)
예제 #9
0
파일: player.py 프로젝트: smnguyen/ml-durak
 def chooseAttackCard(self, options, table, trumpCard, deckSize, opponentHandSize, trashCards):
     print "  Attacking options: ", options
     return util.readIntegerInRange(-1, len(options),
                                    "  Select a card, %s (-1 to stop attack): " % self.name)
예제 #10
0
파일: player.py 프로젝트: smnguyen/ml-durak
 def beginAttack(self, trumpCard, deckSize, opponentHandSize, trashCards):
     return util.readIntegerInRange(0, len(self.hand),
                                    "  Select a card to begin attack, %s: " % self.name)