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