Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
 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
Exemplo n.º 7
0
 def licit(self):
     draw = ""
     while not draw:
         draw = my_input(_How_many_cards_to_claim___0__3____)
     return int(draw)
Exemplo n.º 8
0
 def emel(self):
     return int(my_input(_Where_to_split_the_deck___2__40__))
Exemplo n.º 9
0
 def licit(self):
   draw = ''
   while not draw:
     draw = my_input(_How_many_cards_to_claim___0__3____)
   return int(draw)
Exemplo n.º 10
0
 def emel(self):
   return int( my_input(_Where_to_split_the_deck___2__40__) )