Beispiel #1
0
 def dealCards(self, sound=True):
     if self.cards:
         rows = []
         for r in self.game.s.rows:
             king_seq = False
             for i in range(len(r.cards)):
                 if isAlternateColorSequence(r.cards[-i-1:]):
                     if r.cards[-i-1].rank == KING:
                         king_seq = True
                         break
                 else:
                     break
             if not king_seq:
                 rows.append(r)
         return self.dealRowAvail(rows=rows, sound=sound)
     return 0
Beispiel #2
0
 def canMoveCards(self, cards):
     if len(cards) == 13 and isAlternateColorSequence(cards):
         return True
     return SuperMoveAC_RowStack.canMoveCards(self, cards)
Beispiel #3
0
 def isGameWon(self):
     for s in self.s.rows:
         if s.cards:
             if len(s.cards) != 13 or not isAlternateColorSequence(s.cards):
                 return False
     return True
Beispiel #4
0
 def canMoveCards(self, cards):
     if len(cards) == 13 and isAlternateColorSequence(cards):
         return True
     return SuperMoveAC_RowStack.canMoveCards(self, cards)
Beispiel #5
0
 def isGameWon(self):
     for s in self.s.rows:
         if s.cards:
             if len(s.cards) != 13 or not isAlternateColorSequence(s.cards):
                 return False
     return True
Beispiel #6
0
 def isKingPile(cards):
     return len(cards) > 0 and \
         cards[0].rank == KING and \
         isAlternateColorSequence(cards)