How I Started This NBA Player Generator Thing

So I was watching basketball highlights last night, right? And I kept thinking, man, it’d be kinda fun to just make up new players sometimes. Like, imagine some crazy rookie no one’s ever heard of popping outta nowhere. Yeah, people got those 2K games and all, but I just wanted something simple. Open it up, get a random dude with a name, some stats, maybe a team. Poof, done.

nba player generator

Anyway, I opened my laptop. First thing that came to mind? Google Sheets. Yeah, spreadsheets. Seemed easy enough. I could just whip up random names and slap in numbers. So I started:

  • Made three lists. One for first names (“Jamal”, “Tyrese”, “Marcus”… you know, regular basketball-sounding stuff). One for last names (“Williams”, “Smith”, “Johnson”… classic). And one for positions (PG, SG, SF, PF, C).
  • Tried the =RANDBETWEEN thing. For stats like points, rebounds, assists. Just set some numbers between, say, 5 and 30 for points? Felt random enough.
  • Then I connected it all. Used =RANDBETWEEN to pick positions too. Had =VLOOKUP pull the right position name based on that random number.

Hit enter a bunch. Saw things like “Jamal Williams – SG – 27pts, 8rebs”. Not bad! But… hitting F9 to refresh the whole sheet every time to get just one new player? Felt clumsy. Like using a bulldozer to plant a flower.

Okay, time for something a bit smarter. Opened up my trusty VS Code. Python! Everyone says it’s good for random stuff.

Started simple:


import random

nba player generator

first_names = ["Darius", "Jalen", "Malik", "RJ", "Kawhi"]

last_names = ["Davis", "Antetokounmpo", "Haliburton", "Booker", "Murray"]

positions = ["Point Guard", "Shooting Guard", "Small Forward", "Power Forward", "Center"]

# Grab random ones

f_name = *(first_names)

nba player generator

l_name = *(last_names)

position = *(positions)

# Make a fake rating like in games, from 70 to 89

overall = *(70, 89)

print(f"Meet {f_name} {l_name}, a {position} with Overall Rating: {overall}")

nba player generator

Ran it. Boom! “Meet Kawhi Davis, a Small Forward with Overall Rating: 85”. Nice! Way better. But… Kawhi Davis? Hmm, kinda goofy names sometimes. Needed more names. Went back, stuffed like 20+ names in each list.

Still felt plain. Just a name and one number? Players got stats, man. Points, rebounds, all that.

Time to build him out proper.


# Added stats lists, tweaked the ranges to make sense

points = round(*(10.0, 30.0), 1) # For decimal points!

nba player generator

rebounds = round(*(3.0, 12.0), 1)

assists = round(*(2.0, 10.0), 1)

steals = round(*(0.5, 2.5), 1)

blocks = round(*(0.3, 2.8), 1)

# Made the print way fancier

nba player generator

print(f"n✨ Introducing Rookie Prospect: {f_name} {l_name} ✨")

print(f"Position: {position}")

print(f"Overall Rating: {overall}n")

print(f"Scoring Punch: {points} PPG")

print(f"Board Man Gets Paid: {rebounds} RPG")

nba player generator

print(f"Playmaking: {assists} APG")

print(f"Defensive Pest: {steals} SPG {blocks} BPG")

Ran it again. Got this:


✨ Introducing Rookie Prospect: Malik Haliburton ✨

Position: Power Forward

nba player generator

Overall Rating: 82

Scoring Punch: 24.7 PPG

Board Man Gets Paid: 8.2 RPG

Playmaking: 5.9 APG

Defensive Pest: 1.1 SPG 1.4 BPG

nba player generator

Okay, now we’re talking! Malik Haliburton ain’t a real guy, but those stats? Looks like he could ball! Still… something missing. No team!

Went back to my code. Made a big list of NBA teams. East and West, all of ’em. Added:


teams = ["Lakers", "Celtics", "Warriors", "Bulls", "Heat", "Nuggets", "Mavs", "Sixers", "Bucks", "Knicks"] # You get the idea, added like 20+

team = *(teams)

# Edited the intro line:

nba player generator

print(f"n✨ Introducing the {team}'s Newest Draft Pick: {f_name} {l_name} ✨")

Tested it out. “Introducing the Heat’s Newest Draft Pick: Jalen Antetokounmpo”. Oh man, Giannis’ cousin? That works! Felt like a real rookie profile.

Played around a bit more. Added random heights and weights with reasonable ranges. Made sure centers were taller than point guards. Messed it up at first – had some 6’2″ centers, total disaster! My brain just froze trying to make it connect positions to height ranges. Skipped that for now, made separate lists for guards/forwards/centers heights instead. Cheated? Maybe. Works.

Also added a random “player type” flair thing. Stuff like:


styles = ["Slashing Scorer", "3-and-D Wing", "Floor General", "Paint Beast", "Versatile Defender", "Microwave Scorer", "Athletic Finisher"]

nba player generator

style = *(styles)

print(f"Play Style: {style}")

Final run gave me something like:


✨ Introducing the Bulls' Newest Draft Pick: RJ Murray ✨

Position: Shooting Guard

nba player generator

Overall Rating: 78

Height: 6'5" Weight: 205 lbs

Play Style: 3-and-D Wing

Scoring Punch: 18.3 PPG

Board Man Gets Paid: 4.1 RPG

nba player generator

Playmaking: 3.8 APG

Defensive Pest: 1.7 SPG 0.6 BPG

There it is! Feels alive. Maybe won’t win MVP, but seems useful. Probably will tweak those stat ranges later – maybe make “Paint Beasts” have higher rebound numbers? Dunno yet. Happy I got it from a dumb spreadsheet to a script that actually spits out something fun. Saved it, closed VS Code. Mission good enough.

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。