repl.it
@MattyB10/

Ap project

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#The NBA General Managing Game
print ("The NBA General Managing Game.\nThe rules are: You start off with a random amount of money to pay players to join your team. Each player has a set skill level. The skill level number is how much the player costs to sign. The goal is to sign players to improve your team's overall skill level. Once you sign a player, you cannot trade or release them to free agency.")

import random as rand
money = rand.randrange(15)+2
runningtotal = 0
selectedplayers = []
finalteamrating = 0

fivestar = {'James Harden': 5, 'Kevin Durant': 5, 'Giannis Antetokounmpo': 5, 'Lebron James': 5, 'Anthony Davis': 5, 'Kawhi Leonard': 5}

fourstar = {'Steph Curry': 4, 'Paul George': 4, 'Russell Westbrook': 4, 'Victor Oladipo': 4, 'Kemba Walker': 4, 'Kyrie Irving': 4}

threestar = {'Damian Lillard': 3, 'Jimmy Butler': 3, 'Joel Embiid': 3, 'Karl-Anthony Towns': 3, 'Ben Simmons': 3, 'Donovan Mitchell': 3}

twostar = {'Klay Thompson': 2, 'Devin Booker': 2, 'Luka Doncic': 2, 'Kyle Lowry': 2, 'Trae Young': 2, 'Nikola Jokic': 2}

onestar = {'Serge Ibaka': 1, 'Blake Griffin': 1, 'J.R Smith': 1, 'Lonzo Ball': 1, 'Draymond Green': 1, 'Clint Capella': 1}

q1 = input('Select a team name: ')
print ('You have $',money, '\n')

print ('These are 5 star players', fivestar, '\n\nThese are 4 star players',fourstar, '\n\nThese are 3 star players', threestar, '\n\nThese are 2 star players', twostar, '\n\nThese are 1 star players', onestar, '\n')

while True:
  q2 = input('Do you want to sign some players? Type "yes" or "no"? ')
  if q2 == "yes":
    while True:
      c = input ('Do you have enough money to sign any players you want. Type "yes" or "no"? ')
      if c == "yes":
        q3 = int(input('What is the rating of the player you want to sign (ONLY PUT THE NUMBER). '))
        print ('\n') 
        if q3 == 5:
          print (fivestar)
          while True:
            x = input('\nWhich player would you like to sign. Please type the full name. ')
            if x not in fivestar:
              print ('That player is not rated 5 stars, or has already been signed')
            elif 5.00 > money:
              print ('You do not have enough money for 5 star players')
              break
            else:
              selectedplayers.append(x)
              runningtotal = runningtotal + 5.00
              del fivestar[x]
              money = money - 5.00
              print ('You have $',money, 'left')
              break
        elif q3 == 4:
          print (fourstar)
          while True:
            y = input('\nWhich player would you like to sign. Please type the full name. ')
            if y not in fourstar:
              print ('That player is not rated 4 stars, or has already been signed')
            elif 4.00 > money:
              print ('You do not have enough money for 4 star players')
              break
            else:
              selectedplayers.append(y)
              runningtotal = runningtotal + 4.00
              del fourstar[y]
              money = money - 4.00
              print ('You have $',money, 'left')
              break
        elif q3 == 3:
          print (threestar)
          while True:
            z = input('\nWhich player would you like to sign. Please type the full name. ')
            if z not in threestar:
              print ('That player is not rated 3 stars, or has already been signed')
            elif 3.00 > money:
              print ('You do not have enough money for 3 star players')
              break
            else:
              selectedplayers.append(z)
              runningtotal = runningtotal + 3.00
              del threestar[z]
              money = money - 3.00
              print ('You have $',money, 'left')
              break
        elif q3 == 2:
          print (twostar)
          while True:
            a = input('\nWhich player would you like to sign. Please type the full name. ')
            if a not in twostar:
              print ('That player is not rated 2 stars, or has already been signed')
            elif 2.00 > money:
              print ('You do not have enough money for 2 star players')
              break
            else:
              selectedplayers.append(a)
              runningtotal = runningtotal + 2.00
              del twostar[a]
              money = money - 2.00
              print ('You have $',money, 'left')
              break
        elif q3 == 1:
          print (onestar)
          while True:
            b = input('\nWhich player would you like to sign. Please type the full name. ')
            if b not in onestar:
              print ('That player is not rated 1 stars, or has already been signed')
            elif 1.00 > money:
              print ('You do not have enough money for 1 star players')
              break
            else:
              selectedplayers.append(b)
              runningtotal = runningtotal + 1.00
              del onestar[b]
              money = money - 1.00
              print ('You have $',money, 'left')
              break
      elif c == "no":
        break
  break
print ('You have signed', selectedplayers)
if len(selectedplayers) == 0:
  print ("You didn't sign anyone. The", q1, "suck. \n Your offseason acquisitions were really really really bad.")
else:
  finalteamrating = runningtotal  / len(selectedplayers)
  print ("The", q1,"'s", "average overall rating is", finalteamrating)
  if finalteamrating > 0 and finalteamrating <1.01:
    print("The", q1,"'s", "offseason acquisitions were really bad")
  elif finalteamrating >= 1.01 and finalteamrating <2.01:
    print("The", q1,"'s", "offseason acquisitions were kind of bad")
  elif finalteamrating >= 2.01 and finalteamrating <3.01:
    print("The", q1,"'s", "offseason acquisitions were ok")
  elif finalteamrating >= 3.01 and finalteamrating <4.01:
    print("The", q1,"'s", "offseason acquisitions were pretty good")
  elif finalteamrating >= 4.01 and finalteamrating <=5:
    print("The", q1,"'s", "offseason acquisitions were really really really good. You are the GOAT.")