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

Real Madrid vs Man City: What time is the game? Find out kickoff and how to watch.

So, the Real Madrid vs Man City game. I’d been looking forward to this one for weeks, you...

Decoding dirtbike tire size meaning is key! What do all those letters and numbers really stand for?

Alright, let me tell you, when I first got serious about dirt bikes, looking at tire sizes was...

Easy Peasy 124 lbs to kg Conversion: We Show You How It Is Done for Everyone.

Alright, so today, I found myself needing to switch 124 pounds over to kilograms. It’s one of those...

Remember the awesome 1993 new york yankees roster? Relive the glory with every player name listed!

So, the other day, I got to thinking about baseball from a while back, specifically the early 90s....