repl.it
@MattyB10/

AP project with functions

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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#The NBA General Managing Game
import random as rand
money = rand.randrange(15)+2
runningtotal = 0
selectedplayers = []
finalteamrating = 0
#Signingprocessfunction
def sign(h):
  if q3 == 5:
    selectedplayers.append(h)
    runningtotal = runningtotal + 5.00
    del fivestar[h]
    money = money - 5.00
    return ('You have $',money, 'left')
  elif q3 == 4:
    selectedplayers.append(h)
    runningtotal = runningtotal + 4.00
    del fourstar[h]
    money = money - 4.00
    return ('You have $',money, 'left')
  elif q3 == 3:
    selectedplayers.append(h)
    runningtotal = runningtotal + 3.00
    del threestar[h]
    money = money - 3.00
    return ('You have $',money, 'left')
  elif q3 == 2:
    selectedplayers.append(h)
    runningtotal = runningtotal + 2.00
    del twostar[h]
    money = money - 2.00
    return ('You have $',money, 'left')
  elif q3 == 1:
    selectedplayers.append(h)
    runningtotal = runningtotal + 1.00
    del onestar[h]
    money = money - 1.00
    return ('You have $',money, 'left')

#main
print ("The 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 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.")



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

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

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

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

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

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

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

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). ')) 
        if q3 == 5:
          print (fivestar)
          while True:
            x = input('Which player would you like to sign. Please type the full name. ')
            if x not in fivestar:
              print ('That player is not rated 5 stars')
            elif 5.00 > money:
              print ('You do not have enough money for 5 star players')
              break
            else:
              sign(x)
              break
        elif q3 == 4:
          print (fourstar)
          while True:
            y = input('Which player would you like to sign. Please type the full name. ')
            if y not in fourstar:
              print ('That player is not rated 4 stars')
            elif 4.00 > money:
              print ('You do not have enough money for 4 star players')
              break
            else:
              sign(y)
              break
        elif q3 == 3:
          print (threestar)
          while True:
            z = input('Which player would you like to sign. Please type the full name. ')
            if z not in threestar:
              print ('That player is not rated 3 stars')
            elif 3.00 > money:
              print ('You do not have enough money for 3 star players')
              break
            else:
              sign(z)
              break
        elif q3 == 2:
          print (twostar)
          while True:
            a = input('Which player would you like to sign. Please type the full name. ')
            if a not in twostar:
              print ('That player is not rated 2 stars')
            elif 2.00 > money:
              print ('You do not have enough money for 2 star players')
              break
            else:
              sign(a)
              break
        elif q3 == 1:
          print (onestar)
          while True:
            b = input('Which player would you like to sign. Please type the full name. ')
            if b not in onestar:
              print ('That player is not rated 1 stars')
            elif 1.00 > money:
              print ('You do not have enough money for 1 star players')
              break
            else:
              sign(b)
              break
      elif c == "no":
        break
  elif q2 == "no":
    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.")