Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)
Example #7
0
 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)
Example #8
0
 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)
Example #9
0
 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
Example #10
0
 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