Commits

larry  committed e5e4234

Added summary of played hazards to default display.

  • Participants
  • Parent commits aee0eb1

Comments (0)

Files changed (1)

 #
 # todo:
 #
+#  * when writing out savegame, write to new file then overwrite old file
+#
+#	* when reading savegame, if new file exists, load it, if it is sane
+#	  try to fix situation (mvoe it to old file), if that fails give up,
+#	  if it is not sane try to load old file, if it is sane keep it and
+#	  delete new file, if it is insane give up
+#
+#	* add general purpose "two computers play against each other" facility
+#     not for amusement, but to do A/B testing
+#
+#	* add new features and new tuning to norman, easily changed at runtime,
+#	  so I can run a massive A/B test with all permutations of tuning to see
+#	  what is hardest to beat
 #
 # norman:
 #   * when deciding to continue,
 #   * consider making norman slightly less predictable--add a mild!
 #	  random element making him play safeties when unnecessary / not
 #	  play safeties when opponent is within striking distance
+#   
 #
 # smart computer player
 #	* calculates odds on whether a card is still in the draw pile / in opponent's hand
 #			* even do that for Right-Of-Way (even though unlikely)
 #		* discard hazards in order of how likely the opponent has the remedy / safety
 #	* decides whether to continue based on how much mileage they have / is left
+#   * make him shoot for delayed action--if he's one card away from
+#     winning, and the other player isn't moving, and can't start
+#     moving inside one turn (e.g. you have safety for the hazard
+#     you played on him, and you have ROW), keep discarding cards
+#     and hope you can run out the deck
+#		* what about them stopping you? you should be pretty certain
+#		  you can overcome any hazards he could play
+#		* this might be better for the 
 #
 # store recordings, allow replaying the recordings for debugging
 #
 				break
 
 		print("Game #{game}, Hand #{hand}, it's {player}'s turn.".format(
-			game=str(series.games_played + 1),
+			game=str(series.games_played),
 			hand=str(game.round + 1),
 			player=self.current_player.name,
 			))
 			discard_after = "<"
 		else:
 			discard_before = discard_after = "|"
-		print("draw pile", str(len(hand.draw_pile)).rjust(3) + "/" + str(len(hand.original_deck)), "       discard " + discard_before + pile_repr(series.discard.pile) + discard_after)
+
+		played = ""
+		for card, abbreviation in (
+			(accident,    'a'),
+			(flat_tire,   'f'),
+			(out_of_gas,  'o'),
+			(stop,        's'),
+			(speed_limit, 'l'),
+			):
+			played += ' ' + abbreviation + str(hand.cards_seen[card])
+		print("draw pile", str(len(hand.draw_pile)).rjust(3) + "/" + str(len(hand.original_deck)), "       discard " + discard_before + pile_repr(series.discard.pile) + discard_after + "     " + played)
 		print("         total|hand    miles|battlepile|speed pile|safeties")
 		def stats(player):
 			before_miles = " "