Commits

larry committed 3e6f58c

Bugfix: If you're within one card of winning, and Norman can't stop
you, Norman will play all his safeties in order to try and get a
card that can stop you. However, his logic was off; if he'd extended,
but you were at fewer than 700 miles, he'd get anxious if you were
within one card of getting to 700.

  • Participants
  • Parent commits 614392d

Comments (0)

Files changed (1)

 					safeties_needed_to_win.add(right_of_way)
 			debug("P0.b", we_can_win, safeties_needed_to_win)
 
+		limit = 1000 if hand.extended else 700
 		if we_can_win:
 			# do we have the mileage card we'd need to play?
-			limit = 1000 if hand.extended else 700
 			card_to_win = to_card.get(limit - mileage_so_far)
 			we_can_win = card_to_win in mileage
 			debug("P0.c", card_to_win, we_can_win)
 				return
 
 			other_mileage = other.hand.mileage()
-			if other_mileage >= 700:
-				other_mileage -= 300
 			possibles = {25, 50}
 			if other.hand.autobahn():
 				possibles.add(75)
 				possibles.add(100)
 				if other.hand.two_hundreds() < 2:
 					possibles.add(200)
-			if ((700 - other_mileage) in possibles) and safeties:
+			if ((limit - other_mileage) in possibles) and safeties:
 				debug("P1.c")
 				self.play(safeties[0])
 				return self.turn()