def askPartner(self): selected = False while not selected: crd = my_input(_Choose_your_partner_by_a_card__) if crd: try: num = eval(crd.strip().upper()) selected = True except NameError: pass return Card(num)
def selectToSkart(self, someCards): selected = False helpShown = handShown = False while not selected: crd = my_input(_Choose_one_to_discard__) for card in someCards: if crd.upper() == str(card): selected = True break if not (selected or helpShown): display(" -" * 10 + _You_can_choose_among_, someCards) helpShown = True elif not (selected or handShown): display(" -" * 10 + _Your_cards_, self.cards) handShown = True # to check against rules return card
def selectToSkart(self, someCards): selected = False helpShown = handShown = False while not selected: crd = my_input(_Choose_one_to_discard__) for card in someCards: if crd.upper() == str(card): selected = True break if not (selected or helpShown): display(' -'*10+_You_can_choose_among_, someCards) helpShown = True elif not (selected or handShown): display(' -'*10+_Your_cards_, self.cards) handShown = True # to check against rules return card
def select(self, sofar): selected = False if sofar: display(_So_far, sofar, continueLine=True) handShown = False while not selected: crd = my_input(_Which_card_to_call__) for card in self.cards: if crd.upper() == str(card): selected = True break if not (selected or handShown): display(" -" * 10 + _Your_cards_, self.cards) handShown = True # to check against rules return card
def select(self, sofar): selected = False if sofar: display(_So_far,sofar, continueLine=True) handShown = False cards = self.callableCards(sofar) while not selected: crd = my_input(_Which_card_to_call__) for card in cards: if crd.upper() == str(card): selected = True break if not (selected or handShown): display(' -'*10+_Your_cards_, '[%s]' % ( ', '.join(str(crd) if crd in cards else str(crd).lower() for crd in self.cards) )) handShown = True # to check against rules return card
def licit(self): draw = "" while not draw: draw = my_input(_How_many_cards_to_claim___0__3____) return int(draw)
def emel(self): return int(my_input(_Where_to_split_the_deck___2__40__))
def licit(self): draw = '' while not draw: draw = my_input(_How_many_cards_to_claim___0__3____) return int(draw)
def emel(self): return int( my_input(_Where_to_split_the_deck___2__40__) )