1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Modernise to bonus +=.

This commit is contained in:
Shlomi Fish 2013-04-15 18:49:03 +03:00
parent 3b921faa61
commit b2052c91aa

View file

@ -306,16 +306,16 @@ class DefaultHint(AbstractHint):
bonus = self.BONUS_DROP_CARD
if t.cards and t.cards[-1].suit == pile[0].suit:
# simple heuristics - prefer moving high-rank cards
bonus = bonus + self.BONUS_SAME_SUIT_MOVE + (1 + pile[0].rank)
bonus += self.BONUS_SAME_SUIT_MOVE + (1 + pile[0].rank)
elif self._preferHighRankMoves():
# simple heuristics - prefer moving high-rank cards
bonus = bonus + self.BONUS_NORMAL_MOVE + (1 + pile[0].rank)
bonus += self.BONUS_NORMAL_MOVE + (1 + pile[0].rank)
elif rpile:
# simple heuristics - prefer low-rank cards in rpile
bonus = bonus + self.BONUS_NORMAL_MOVE + (self.K - rpile[-1].rank)
bonus += self.BONUS_NORMAL_MOVE + (self.K - rpile[-1].rank)
else:
# simple heuristics - prefer moving high-rank cards
bonus = bonus + self.BONUS_NORMAL_MOVE + (1 + pile[0].rank)
bonus += self.BONUS_NORMAL_MOVE + (1 + pile[0].rank)
return bonus