Example #1
0
def main(raw_input=raw_input):
    player_collection = get_participating_players()
    tournament = Tournament(player_collection)
    wants_another_game = "y"

    while wants_another_game == "y":
        winner = tournament.play_game()
        try:
            winning_marker = winner.marker
            print "The winner is player", winning_marker
        except:
            print "The game is a tie! Everybody wins!"
        wants_another_game = raw_input("Another game? (y for yes):")

    print_results(player_collection)
Example #2
0
 def setUp(self):
     self.player1 = ComputerPlayer('X')
     self.player2 = ComputerPlayer('O')
     self.players = (self.player1, self.player2)
     self.tournament = Tournament(self.players)