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

why use mohammed mohammed mohammed top benefits explained here

My First Encounter with Mohammed Mohammed Mohammed Stumbled upon this “mohammed mohammed mohammed” thing while scrolling through forums last...

Celtic 23-24 kit prices compared? (Save money with buying hacks)

So last week I decided I absolutely had to get the new Celtic home kit for this season....

Lakers Courtside Season Tickets How to Buy Your Own Seat Step-by-Step Guide

The Whole Journey to Get Courtside Seats Okay, so I’ve been obsessed with the Lakers forever, right? And sitting...

即时性需求引导专业报告资源(18词)

So the other day I was scrambling to find reliable industry reports for my consulting gig, hitting dead...