def computeHints(self): CautiousDefaultHint.computeHints(self) if self.hints: return for r in self.game.s.rows: if not r.cards: for s in self.game.s.reserves: if s.cards: self.addHint(5000-s.cards[0].rank, 1, s, r)
def computeHints(self): CautiousDefaultHint.computeHints(self) if self.hints: return if not self.game.s.talon.cards: return for s in self.game.s.reserves: if s.cards: for r in self.game.s.rows: if r.acceptsCards(s, s.cards): self.addHint(5000, 1, s, r)
def computeHints(self): CautiousDefaultHint.computeHints(self) if self.hints: return if not self.game.s.talon.cards: return c = self.game.s.talon.cards[-1].rank if 0 <= c <= 3: r = self.game.s.xwastes[0] elif 4 <= c <= 7: r = self.game.s.xwastes[1] else: r = self.game.s.xwastes[2] self.addHint(5000, 1, self.game.s.talon, r)
def computeHints(self): CautiousDefaultHint.computeHints(self) if self.hints: return if not self.game.s.waste.cards: return r = self.game.s.waste.cards[-1].rank if 0 <= r <= 3: to_stack = self.game.s.reserves[0] elif 4 <= r <= 7: to_stack = self.game.s.reserves[1] else: to_stack = self.game.s.reserves[2] self.addHint(5000, 1, self.game.s.waste, to_stack)
def computeHints(self): CautiousDefaultHint.computeHints(self) if self.hints: return if not self.game.s.talon.cards: return c = self.game.s.talon.cards[-1].rank - self.game.base_card.rank if c < 0: c += 13 if 0 <= c <= 3: r = self.game.s.reserves[0] elif 4 <= c <= 7: r = self.game.s.reserves[1] else: r = self.game.s.reserves[2] self.addHint(5000, 1, self.game.s.talon, r)
def _getMovePileScore(self, score, color, r, t, pile, rpile): # prefer reserves if not r in self.game.s.reserves: score = score - 10000 # an empty pile doesn't gain anything if len(pile) == len(r.cards): return -1, color return CautiousDefaultHint._getMovePileScore(self, score, color, r, t, pile, rpile)
def _getMoveWasteScore(self, score, color, r, t, pile, rpile): score, color = CautiousDefaultHint._getMovePileScore( self, score, color, r, t, pile, rpile) # we prefer moving cards from the waste over everything else return score + 100000, color