Guess the Player Quiz: Test Your Knowledge of Famous Players.

Date:

Share post:

Okay, so today I wanted to make a simple game, “Guess the Player.” The idea is pretty basic: the computer picks a random soccer player, and you have to guess who it is based on some clues. I thought it’d be a fun little project to mess around with.

Guess the Player Quiz: Test Your Knowledge of Famous Players.

First, I needed a list of players. I just grabbed a list of, like, the top 50 or so players – you know, the big names everyone knows. I put them all in an array.

Next, I needed a way to pick a player at random. I found this simple function online that shuffles the array and then just picks the first one. That seemed to work fine, so I just used that.

Building the Clues

Now for the clues… I figured I’d give, like, three clues: their position, their nationality, and maybe a team they’ve played for. So, I added that info to each player in my list. It was a bit tedious, but not too bad.

I made a function to display the clues one by one. I put a little delay between each clue so it’s not all revealed at once. Makes it a bit more suspenseful, you know?

Getting User Input

Then I needed a way for the user to guess. I just used a simple input box where you can type in the player’s name. I made it so it’s not case-sensitive, because who can remember how to spell every player’s name perfectly?

Guess the Player Quiz: Test Your Knowledge of Famous Players.

I put in some simple check to see if the guess is right. If it is, I display a “You Win!” message. If not, I show a “Try Again!” message. I also put in the correct answer is at the end if you couldn’t guess.

The Game Loop

  • Start:Pick a random player.
  • Clue 1: Show the player’s position. Get a guess. Check it.
  • Clue 2:Show the player’s nationality. Get another guess. Check it.
  • Clue 3: Show a team the player’s played for. Final guess. Check it.
  • End: Either say they won or reveal the answer.

I made it loop through those clues, getting a guess after each one. If the user gets it right at any point, the game ends. If they get through all the clues and still haven’t guessed, it reveals the answer.

So, yeah, that’s pretty much it. It’s a simple little game, nothing fancy, but it was fun to build. I might add some more features later, like a scoring system or maybe a timer. But for now, it’s a good little time-waster.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related articles

cb550four for Sale? Find Your Dream Bike Here! (Tips & Tricks)

Alright, let’s talk about my recent deep dive into the world of the CB550Four. I’ve always been a...

Staying at Lumpinee Hotel Bangkok? Read This First!

Okay, so I wanted to find a place to stay in Bangkok, and Lumpinee kept popping up. I...

RPM Compression Ratio: What Is It and Why Does It Matter?

Today, I was digging into some data stuff and stumbled upon this thing called “RPM compression ratio.” I’d...

Who is Tien Shinhan? Dragon Ball Character easy guide!

Okay, so I’ve been meaning to mess around with drawing Dragon Ball characters for a while, and today...