sorry about not posting last friday my website was down but it working now so anyway i fixed the free agency logic and i added a playoffs file i added each team buget
the conracts will all be random for example james harden lets say he signed with the bulls for 5 years for oh i dont know 24.6 millon then the code would print james harden has signed a 5 year $24.6 millon deal with Chicago Bulls
while game_num <= 7:
print(f"\n--- Game {game_num} ---")
def simulate_series(team1, team2):
t1_wins = 0
t2_wins = 0
game = 1
while t1_wins < 4 and t2_wins < 4:
# Simple simulation: random score between 95 and 125
t1_score = random.randint(95, 125)
t2_score = random.randint(95, 125)
if t1_score > t2_score:
t1_wins += 1
print(f"Game {game}: {team1} wins ({t1_score}-{t2_score})")
else:
t2_wins += 1
print(f"Game {game}: {team2} wins ({t2_score}-{t1_score})")
game += 1
print(f"Series Final: {t1_wins}-{t2_wins}")
now has we all know the nba has a 7 game sries or frist team to win 4 games so for example:
has u can see from this example where CLEVLAND beat golden state 4 games to 3 (the full 7 games) this the code will do the same but everytime it will be diffent and you the user can import your own score so just as a exmaple LAL (lakers) and CLE(CAVS) lets say game 1 in LA 99-74 LA WINS 1-0 THEN GAME 2 IN LA 110-97 LA WINS GAME 3 IN CLEVLAND 117-114 CLE WINS GAME 4 IN CLEVLAND 135-140 LAL WINS AT THAT POINT IT WOULD BE 3-1 LAL LEADS SRIES
2 responses to “nba sim”
very good job Larry! – Braiden, Kadris, Gabe, Ace, Aubrey.
thanks