mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
Modernise to bonus +=.
This commit is contained in:
parent
3b921faa61
commit
b2052c91aa
1 changed files with 4 additions and 4 deletions
|
@ -306,16 +306,16 @@ class DefaultHint(AbstractHint):
|
||||||
bonus = self.BONUS_DROP_CARD
|
bonus = self.BONUS_DROP_CARD
|
||||||
if t.cards and t.cards[-1].suit == pile[0].suit:
|
if t.cards and t.cards[-1].suit == pile[0].suit:
|
||||||
# simple heuristics - prefer moving high-rank cards
|
# 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():
|
elif self._preferHighRankMoves():
|
||||||
# simple heuristics - prefer moving high-rank cards
|
# 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:
|
elif rpile:
|
||||||
# simple heuristics - prefer low-rank cards in 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:
|
else:
|
||||||
# simple heuristics - prefer moving high-rank cards
|
# 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
|
return bonus
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue