

def copy (self): create/return a new Move object that has the same cooperation status.def change (self): change the cooperation status of this move.defeq (self, other): return boolean: whether this move has same cooperate value as the other.def _repr_(self): create/return a string as in this example: "Move(True)".

def _str_ (self) return "." for a cooperating move,"x" for a non-cooperating move.definit_(self, cooperate True): constructor of a move: create/initialize the cooperate field.class Move: represents one move, indicating a choice to cooperate or not. Just be sure to complete the init/str/repr/eq definitions before moving on to other classes that use them! Methods return None when no other return value is specified. Many of the methods are quite simple, once you get comfortable accessing the fields of the object. Required Classes Working through the classes in the given order is the simplest path to assignment completion, but many methods can be completed out of order if you get stuck on others. (this was the "detective" in the shared link) If ever they are betrayed, they behave like previous does. detective starts with cooperate, cheat, cooperate, cooperate then if they've never been betrayed, they cheat.(this was the "grudger" in the shared link) grudger cooperates as long as the opponent does, but after one non-cooperation, never cooperates ever again with this opponent.(this was the "cheater" in the shared link). May be vulnerable to abuse! (this was the "cooperator" in the shared link). friend always cooperates, no matter what.(this was the "copycat" in the shared link). previous starts by cooperating, then always copies the previous move of their opponent.Kinds of Players There are five kinds of players in our version of the tournament. After all rounds have been played, we see the "evolved" population of who remains, as a summary dictionary of the count of each style of player that survived.

At the end of the round, some lowest scorers are removed (and any others with negative points), and some highest scorers are duplicated. Each round, all players play each other once, accumulating or losing points. Their increasingly shared history will certainly affect their chosen behavior: will they keep cooperating even if their opponent doesn't? Will they hold grudges? Between games, players will reset their history, perhaps this new person is more trustworthy! A tournament involves multiple players.

One game is defined as two players playing multiple turns together. A player's points may go negative, and yet they can still spend/lose more points. Shared history against this player is available to players, and they may use this to guide their decision. That wasn't very kind! One turn is defined as each player making a choice, and winning or losing some points as a result. one cheats, the cheater gets +3 and the cooperator loses a point. If they both cheated, nobody wins anything. If they both cooperated, they each win two points. They each decide independently to "cooperate" or "cheat".
