def main(): # set up the data # set up 8 teams # only one manager per team # only one league players = [] for i in range(100): players.append(generate_player()) # more teams will be added later on teams = [ Team('Toronto Raptors'), Team('Los Angeles Lakers'), Team('Houston Rockets'), Team("Golden State Warriors"), Team('Oklahoma City Thunder'), Team('Philadelphia 76ers'), Team('Portland Trail Blazers'), Team('Milwaukee Bucks') ] for team in teams: # give them 5 starting players for player_num in range(5): selected_player = random.choice(players) team.players.append(selected_player) players.remove(selected_player) # one league first_league = League('NBA') first_league.set_teams(teams)
def main(): # Set Up # Generate some players players = [] for i in range(100): players.append(generate_player()) # Set up 5 teams teams = [ Team("Chelsea"), Team("Man City"), Team("Arsenal"), Team("West Ham"), Team("Man Utd"), Team("Hull City"), ] # Giving players to team for team in teams: for player_num in range(11): selected_player = random.choice(players) team.players.append(selected_player) players.remove(selected_player) # We have a single league first_league = League("Premiership League", teams, players) first_league.set_teams(teams) # create the manager manager = TeamManager(random.choice(teams), first_league) print("Season begins...") for i in range(10): manager.manage() first_league.play_round() print("Season ends...") print("*" * 30) print("Your final score card.") manager.get_team_status() print("*" * 30)
def main(): # set up our data # generate some players, random(a couple hundred) fighters = [] for i in range(100): fighters.append(generate_fighter()) # set up 5 teams teams = [ Team('Avengers'), Team('Annihilators'), Team('Black Panthers'), Team('Brute Force'), Team('Chaos'), Team('Full Atack') ] for team in teams: for fighter_num in range(5): # 5 fighters given from start at random selected_fighter = random.choice(fighters) team.fighters.append(selected_fighter) fighters.remove(selected_fighter) # create random fighters, create random managers(the player is one of those managers) first_league = League('Battle Zone', teams, fighters) first_league.set_teams(teams) # create the manager(player) manager = TeamManager(random.choice(teams), first_league) """ play 10 rounds between all our teams """ print('Tournament begins.') for i in range(10): manager.manage() first_league.play_round() print('Tournament ends.')