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
def canMoveCards(self, cards): if len(cards) == 13 and isAlternateColorSequence(cards): return True return SuperMoveAC_RowStack.canMoveCards(self, cards)
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
def isKingPile(cards): return len(cards) > 0 and \ cards[0].rank == KING and \ isAlternateColorSequence(cards)