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

What Are the 6 Goals in the Preamble Explained Simply for You Today

Alright folks, buckle up. You know me, I’m always poking around trying to make sense of things, especially...

Where to Buy 1974 Camaro for Sale? Top Places Check Now!

So look, I wanted a 1974 Camaro for ages. Like, really bad. Everyone kept saying they’re rare or...

Seitzer vs Others: Which Performs Better For Your Needs

Okay folks, grab a coffee because this one got messy. I was trying to automate some boring data...

Top 5 Epic Rivalry Games of Shaq and Tim Duncan

So I decided to dive into NBA history yesterday and make that Shaq vs Duncan rivalry video everyone...