Ejemplo 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]
Ejemplo 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]
Ejemplo 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]
Ejemplo 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]
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)