Untitled
unknown
plain_text
a year ago
2.1 kB
6
Indexable
import random
def generate_player_stats(position):
# Base stat ranges for all players
stats = {
"Speed": random.randint(70, 99),
"Strength": random.randint(50, 85),
"Agility": random.randint(60, 95),
"Acceleration": random.randint(70, 99),
"Jumping": random.randint(60, 95)
}
# Add position-specific stats
if position == "Quarterback":
stats.update({
"Throw Power": random.randint(75, 99),
"Throw Accuracy Short": random.randint(70, 95),
"Throw Accuracy Medium": random.randint(65, 90),
"Throw Accuracy Deep": random.randint(60, 85),
"Awareness": random.randint(60, 95)
})
elif position == "Running Back":
stats.update({
"Carrying": random.randint(70, 99),
"Break Tackle": random.randint(65, 90),
"Trucking": random.randint(60, 85),
"Elusiveness": random.randint(70, 95),
})
elif position == "Wide Receiver":
stats.update({
"Catching": random.randint(70, 99),
"Route Running": random.randint(65, 95),
"Spectacular Catch": random.randint(60, 90),
})
elif position == "Defensive Player":
stats.update({
"Tackling": random.randint(65, 95),
"Block Shedding": random.randint(60, 90),
"Play Recognition": random.randint(60, 95),
})
elif position == "Offensive Line":
stats.update({
"Run Blocking": random.randint(70, 95),
"Pass Blocking": random.randint(70, 95),
"Awareness": random.randint(60, 90),
})
# Calculate Overall Rating (simplified as an average)
overall = sum(stats.values()) // len(stats)
stats["Overall"] = overall
return stats
# Example Usage
player_position = "Quarterback" # Change this to Running Back, Wide Receiver, etc.
player_stats = generate_player_stats(player_position)
# Display the generated stats
for stat, value in player_stats.items():
print(f"{stat}: {value}")Editor is loading...
Leave a Comment