Esempio n. 1
0
    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]
Esempio n. 2
0
    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]
Esempio n. 3
0
 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]
Esempio n. 4
0
 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]
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 8
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)
Esempio n. 9
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)
Esempio n. 10
0
 def beginAttack(self, trumpCard, deckSize, opponentHandSize, trashCards):
     return util.readIntegerInRange(0, len(self.hand),
                                    "  Select a card to begin attack, %s: " % self.name)