+# * '>' (shift '.') means "discard until end of hand"
# Copyright 2012 Larry Hastings
# This software is provided 'as-is', without any express or implied
-# warranty. In no event will the authors be held liable for any damages
+# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
# Permission is granted to anyone to use this software for any purpose,
# should play ROW and move if delta in miles gets big
# or opponent is about to win
# likelyhood should go way up if they might get shut out
+# * decide to extend based on delta in score--extend if opponent
+# mileage is > 0 but norman has a big lead, make it less likely
+# * 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
# * calculates odds on whether a card is still in the draw pile / in opponent's hand
def __init__(self, player):
Rosey is the dumbest player who could play a legal game.
On every turn she shuffles her cards.
n then tries each in order.
+ She then tries each in order.
If she finds a card that is legally playable, she plays it--
unless it's redundant (plays hazards only when stopped, plays
speed limit only if you don't already have one)
- "Norman" is a reasonably sophisticated player.
+ "Norman" is a reasonably sophisticated player. Norman plays
+ by a very specific set of rules:
* understands coup fouree
Moriarty is as smart as I can make him.
- His main achievement over
AverageComputerPlayer is that
+ His main achievement over is that
he counts cards and calculates odds.
(Moriarty is named for the machine intelligence that escaped
S - show current scores as if each player had won the current hand
t - redraw the table (discard, piles, etc)
+ ! - discard all remaining cards (deck is empty, you have nothing useful)
Ctrl-C - exit, automatically saving state
prompt += " or [d]raw? > "
- prompt += " or [.]discard? > "
- c = self.getch(prompt, valid)
+ prompt += " or [.!]discard? > "
+ if not self.hand.discard_all:
+ c = self.getch(prompt, valid)
self.hand.last_drawn = card = self.hand.draw()
c2 = self.getch(" Discard which card? [" + valid_cards + "] > ")
if c2 not in valid_cards:
+ elif self.hand.discard_all:
+ print("Deck isn't empty! There's still hope!")
+ self.hand.discard_all = True
assert '1' <= c <= str(len(self.hand.hand))