Guess what number
Free Online Logic Puzzle Half Splitting Number Guessing Video Game for Kids
Add game to your favorites
This is a classic guessing game that challenges your basic mathematical logic comprehension. Simply guess the number within a few tries to win. Compare the your previous guesses to the unknown number to narrow down your list of candidate numbers.
- Enter your guess using the onscreen number pad.
- Use the greater than/less than table to help you track the number’s possible value.
- Play through 3 difficulty levels.
Overall
Design
Difficulty
Replay
Play Guess the Number Game Online
Children and parents can play this number guessing game by clicking in the window below.
Alternatively kids and adults can play this integer guessing video game for free as a web application here.
Guess the Number Game for Kids Video Game Play Instructions
- Starting the Game
- Select the green and white play button to load the welcome screen.
- On the welcome screen, select Go on the bottom center to begin.
- Game Controls
- Desktop
- With your mouse, left click on the buttons in the number pad to enter your guess.
- Touchscreen devices
- Tap on the buttons in the number pad with your fingers to enter your guesses.
- Desktop
- Game Play
- Difficulty
- Choose a difficulty level. These are based on the range of numbers you can guess from.
- Easy: 1 to 10
- Medium: 1 to 100
- Hard -500 to 500
- The harder the difficulty level, the more guesses you have to work with.
- On easy, you have 5 tries.
- On medium, you have 7 tries.
- On hard, you have 10 tries.
- Choose a difficulty level. These are based on the range of numbers you can guess from.
- Basic rules
- Use the calculator on the right side of the screen to input your number.
- Select the numbers.
- Select clear to remove your guess and start over.
- Select check to enter your guess.
- Your hints come in the form of a table.
- On one side is the numbers it is greater than, and on the other are the numbers it is less than.
- Each time you make an incorrect guess, the game clues you in by saying how much bigger or smaller in value the real number is.
- Use the table to narrow down your possible searches.
- Use the calculator on the right side of the screen to input your number.
- Strategy
- Start with middling numbers based on the size of the range.
- For the easy mode, this would be 5. For hard mode, this would be 0.
- Doing so will automatically narrow down your search to a specific range of numbers.
- For instance, in hard mode, if the number is greater than 0, it cannot be a negative.
- In easy mode, meanwhile, if the number is less than 5, it could be anywhere between 1 and 4.
- Keep halving the number range to find the narrowest possible range of potential guesses.
- This process of elimination will help you conserve your tries.
- If you know a hard mode number s greater than 0 use 250 as your next guess.
- Depending on the result of that your next guess should be 125 or 375.
- Each time you guess the remaining range gets cut roughly in half from 1,000, to 500, to 250, to 125, to 62, to 31, to 15, to 8, to 4, to 2.
- When dealing with larger numbers, you will need as many free tries to refine your range.
- Start with middling numbers based on the size of the range.
- Difficulty
- Target Audience
- The game is suited for players who like simple educational math games.
- The game has no adult themed content.
Like This Game? Review This Number Guessing Video Game for Young Girls & Boys
Guess the Number
Overall3.1
Design3.6
Fun3.1
Originality1.7
Replayability2.8
What people say... Leave your rating
Order by: Most recentTop scoreMost helpfulWorst score
Be the first to leave a review.
{{{ review.rating_title }}}
Show more
Leave your rating
- Overall
- Design
- Fun
- Originality
- Replayability
Free Online Guess the Number Video Game for Children & Adults Screenshots
Mobile Friendly Cross Browser Support
This game is rendered in mobile-friendly HTML5, so it offers cross-device gameplay. You can play it on mobile devices like Apple iPhones, Google Android powered cell phones from manufactures like Samsung, tablets like the iPad or Kindle Fire, laptops, and Windows-powered desktop computers. All game files are stored locally in your web browser cache. This game works in Apple Safari, Google Chrome, Microsoft Edge, Mozilla Firefox, Opera and other modern web browsers.
Plays.org published this Math on February 8, 2022 / 0 Comments
Guess my number - CS Unplugged
This is similar to the game of 20 questions, but it is about guessing a number with the strict rule that you can only answer whether the secret number is greater than or equal to a guessed number.
What you need
- At least 2 people
- A pen or pencil
- Two or three pieces of paper
Skills needed
- Comparing numbers up to 100
Key question
How quickly can you find an answer just by asking questions that have a yes or no answer?
Activity steps
I’ve written a secret number on this paper, and you need to work out what it is. It’s between 1 and 100. Each time you tell me a number, I’ll tell you if my number is greater than or equal to your one. I won’t tell you if it’s equal - but you’ll still be able to work out my number!
Write a number on some paper, and fold it over so it can’t be seen. It can be any number from 1 to 100; in the example below the parent happens to have chosen 52 as the secret number.
What number do you want to guess first?
Write a "greater than or equals" symbol followed by their guess. (In the example, the child has guessed 50.)
(Depending on the number)
My secret number is not greater than or equal to your guess.
or
My secret number is greater than or equal to your guess.
Write a tick or cross depending on whether it is greater than or equal. Since 52 (the secret number) is greater than or equal to the guess (50), the presenter has written a cross.
Do not tell them if they have guessed your number! They will need to work out when they have enough information to know the number, so this is different to traditional versions of games like "20 guesses". The best guessing strategy is to start by guessing 50 (which the child happened to do in this case), but it’s fine if the child wants to use another approach - let them work it out for themselves!
Which number do you want to guess next? Again, say one of these:
My secret number is not greater than or equal to your guess.
or
My secret number is greater than or equal to your guess.
In this case the child has guessed 75. The secret number isn’t greater than equal to 75, so the presenter has marked it with a cross.
This repeats until the child can guess the number.
In the example, the child happens to have named the secret number (52), but the presenter has only said that their guess is greater than or equal to the secret number.
As it happens, the child can deduce that the number must be 52 from the information available, since they found out earlier that it’s not greater than or equal to 53. It can take a bit of logic to work this out, but it’s always possible to narrow in on the number.
You can play this game a few times so that they can refine their strategy and develop their logical thinking to find the answer. After a while they may discover that it’s strategic to keep dividing the range in half.
Inside the computer
This activity touches on several key ideas in computing. One is that dividing big problems in half, then half again, and so on, makes them very small very quickly. With 100 possible values, only 7 questions are ever needed to narrow down to the secret value if you use the right strategy. In Arnold’s challenges students can experiment with guessing numbers from 1 to 1000 - it looks like it would be 10 times as hard, but it only needs three more questions! Every time the range doubles in size, you only need one more question to guess a number in the range. In fact, you could guess a number from 1 to a million using only 20 questions - it doesn’t take that long, although you might want to use a calculator to half the range each time. This approach to narrowing down towards a solution is behind some very fast computer algorithms.
Another idea in the activity is that you can achieve a lot with only "binary" yes/no decisions. You might think that you need to check if the final value is equal, but you can know for use only by using "greater than or equal". Decisions that have two outcomes (often referred to as true or false) are the basis of "Boolean logic", which is one of the key ideas used in the design of digital devices.
Arnold's challenges
Click here to view Arnold's challenges:
Arnold's Challenges
Guess the number
In this tutorial we will learn the basic components of Aimylogic that will be needed to create any bot. As a result, we will get a bot that guesses a random number and invites the user to guess it during the dialogue.
Behavior of the bot
Our conversational bot should guess a number randomly. Next, the user puts forward his guess. If his guess is wrong, then the bot must say whether the number guessed by the bot is greater or less and prompt the user to try again. And so on until the user guesses the number guessed by the bot. After that, you can offer to play again.
Examples of dialogue with this bot:
Creating a script
Go to app.aimylogic.com. Create a new account or log in to your account.
Click "Create a bot or call" to create a new script:
Give the script a name, select the Russian language and click Continue .
Let's develop a scenario
The bot works according to the scenario that you develop. You can control the specific behavior of the bot by making changes to the script.
- Greeting
At the start, our bot should tell the user the rules of the game and offer to play. To add a greeting message
The start screen is the screen that is on the left and at the top. The bot will always start chatting from this screen.
To add a greeting, press Text .
This will create block Text . Let's write in it:
Hello!
Click Save to add this block.
We have a start screen with block Text , in which the message "Hi!".
- How do I add a screen title?
For convenience, let's add a label to this screen - the name of the script.
To do this, click on the sign # in the top line of the screen
Enter the name of the screen:
welcome
And select color
Screen name added:
- Go to next screen
For convenience, in order to further redirect to the screen with an offer to play, add a Transition block here, which will redirect to the next message.
Press + BLOCK and select block Transition
| More about block Transition read here.
- Offer to play
Let's add an offer to play Guess the Number.
We need the bot to redirect to the offer to play after the greeting, for this we use the block Transition . To create a connection, click on the block itself Transition :
The block selection window will appear. Select Text
Let's write in it:
Let's play Guess the Number?
Let's call this screen:
play
- Accept user response
Add block Intents to the "play" screen. This block accepts user input. Block Intents should be on all screens where you expect the user to write something.
Learn more about the Intents block.
Aimylogic already has ready-made intents created for your convenience. They contain popular phrases sorted by user intent.
| Read more about Ready Intents here.
Click Choose ready -made intent
Highlight ready -made intenses - Consent , Refusal and Farewell :
Press Select 9000
000
Let's add the "play" screen to the "Come on!" button.
Read more about buttons here.
Press + BUTTON , enter text:
Come on!
And press Enter, or click on an empty space on the screen.
- Guess the number
To generate a random number, we need a third-party service that can generate a random number on request. Such a service can be the site random.org, which can generate truly random numbers and events. This site has an API with which our bot can get a random number. We can use this API with block HTTP request .
- Click on the intent Consent .
In this way, we will create a link from intent Consent and define what the bot will do when the user says "yes", "okay", "come on", "okay", etc.
- Select block HTTP request .
Let's format the question as follows:
https://www.random.org/integers/?num=1&min=1&max=100&col=1&base=10&format=plain&rnd=new
In this URL, we have indicated that we will return a random number from 1 to 100.
If you open this address in a browser, you will see that it simply returns some integer from one to one hundred. If we reload the page, a new random number will appear, just what we need.
Our bot should request this number and store it in some variable, with which it will then compare the user's response.
Variables are like boxes in which we put something, some information. For order, it is convenient to sign the boxes, so each variable has its own name.
In Aimylogic we write variables using $
followed by the variable name. Case matters - variables $number
and $NUMBER
are different variables.
| Read more about variables here.
- On the RESPONSE tab, click + . Copy and paste in the fields:
Variable name :
num
In field Value copy and paste:
parseInt($httpResponse)
What's going on here?
After the HTTP request , Aimylogic saves the response of the random.org service to the system variable $httpResponse
. But the random.org service returns text, and we need an integer so that we can compare the user's number with it (string and number are different data types in Javascript). Therefore, we need to first convert the text response of the service to an integer. To do this, Javascript has a parseInt function, which we will use.
Let's pass the entire response from the service to the function parseInt
- this is how we convert the string into a number. We then write that value to the variable we specified in the ?? and store it in the variable $num
.
- Let's call this screen:
request
- Now guess!
The bot received a random number. The bot should now display a message to the user that a number has been guessed and invite the user to guess the number.
- Click on option Completed successfully block HTTP request and create block Text . In it write:
I guessed a number from 1 to 100. Guess what!
- Let's call this screen:
guessed
- And add "guessed" block Transition : to the screen
This is what we get:
- Let's take user input
* $NUMBER *
$NUMBER
is a system variable that accepts numbers. At the same time, numbers can be called both numbers - 1, 3, 99, and words - one, three, ninety-nine.
Asterisks mean that any words can be before and after $NUMBER
. This way the bot will be able to understand if the user says something like "Probably five". The bot will get "five" out of there.
| For more information about asterisks and other ways to accept input in intents, see the article on template syntax.
- Then press SELECT READY INTENT and select ready intents - Agree , Reject , Greeting , Farewell .
Thus, we provide for different user reactions, and then tell the bot what to do in response to such replicas.
receiving input
Here's what we got:
We've moved block Intents to a separate screen to make it easier to redirect here in the future.
- Checking the range of the number
We need to make sure the user entered a number that is not greater than 100 and not less than 1.
- Click on the intent
* $NUMBER *
and create block Conditions .
Block Conditions is used when you want to add non-linearities to the dialog. You can write a Javascript expression string to a condition string. Depending on the fulfillment of one or another condition, the bot goes to different screens. If the condition in block Condition is met (if it is "true"), then the bot translates according to the link from this expression. If none of the expressions are executed (they are all "false"), then the bot checks the expressions below. If none of the expressions is true, then the bot goes to else . Conditions are executed from top to bottom. This means that if the upper condition is met, the bot leaves the link from it and ignores the conditions below.
In block Conditions , you can specify several js expressions - several dialog branches. In our case, we will have three branches: when the number specified by the user is greater than 100, when it is less than 1. Well, and the third - when the number is not less than 1 and not more than 100, that is, else, which is added automatically.
Read more about block Conditions here.
Copy and insert the conditions :
$ Number> 100
Click + Condition and add another line:
$ Number <1
9000 9000
-
Press Save .
-
Let's name this screen:
range
Here's what we got:
- Move the screens for a compact display. To move the screen, point to the upper left corner of the screen and drag:
- If the number is not in the range of
If the user has entered a number greater than 100 or less than 1, we need to issue a message to enter a number that falls within the range.
- Therefore, from the condition
$NUMBER > 100
create block Text in which we write:
Name a number from 1 to 100!
- Let's call this screen:
name the number
- Link the condition
$NUMBER < 1
(if the number is less than one) to the "say the number" screen. To link an existing screen to another screen, click on the circle and drag the arrow to the target screen:
- Add block Transition to the "say a number" screen and link it to the "receive input" screen:
This is what we got:
Thus, when the user calls the number "two hundred" or "zero", the bot will say "Name a number from 1 to 100!". Then, since the bot took the user to the intent screen, the bot will be able to accept the user's response again.
- Testing
We can check that everything works as we intended. Of course, the script is not yet completely ready, but we can check that what we have developed works.
- Press Test . The test widget will open.
Right now we only have a branch that says the number is out of range. Therefore, we will call numbers greater than 100 and less than 1.
- Let's talk to the bot as follows:
If the test does not work as shown in the screenshot, please check the previous steps.
What if I made changes to the script, but everything is the same in testing?
| If you want to make changes to the script (add, delete or fix something, change links, etc.) and check how the new version of the script works, you must restart testing, that is, press STOP TEST and then press **Test again.
How to start the same dialogue from the start?
To start the session from the beginning, click on this icon:
Then the bot will start the dialogue from the start. ---12. If the number is in the range
If the number is less than 100 and greater than 1, then the expressions in our block Conditions will not be executed and the bot will go to else .
- From else create a new block Conditions , in which we write:
$num < $NUMBER
$num > $NUMBER
- Let's call this screen:
comparison with the guessed number
0056 $num using block HTTP request ) with the number that the user has guessed (this number is written in $NUMBER
).
This is what we got:
- If the number is less than
- Click on line
$num < $NUMBER
and create block Text :
My number is less! Try again.
- Let's call this screen:
less than
- Let's add the block Transition to the "less" screen and link it to the "receive input" screen.
- If the number is greater than
- From condition
$num > $NUMBER
create block Text :
My number is bigger! Try again.
- Let's call this screen:
more
- Add block 9 to the "more" screen0004 Transition and associate it with the "receiving input" screen.
- If the number entered by the user is equal to the number guessed by the bot
If the user guessed correctly, then the number will be no more and no less, which means that the bot will go to else.
- Click on the else screen "comparison with the hidden number" and create a block Text :
Correct! I guessed $num!
- Let's call this block:
guessed right
- Will we play again?
- Add "guessed" block Transition to the screen. From this block Transition create a new block Text :
Shall we play again?
- Let's call this screen:
will we play again?
- Add ready-made intents to the "let's play again" screen Agree , Reject , Farewell .
Associate intent Consent with the request screen.
- If the user no longer wants to play
- From intent Rejection screen "play again? * create block Text :
Well, bye!
- Let's call this screen:
farewell
- Linking the intent Farewell from the "play again?" with farewell screen:
- Associate the intent Failure of the "receiving input" screen with the "farewell" screen:
- Associate the intent Farewell of the "receiving input" screen with the "farewell" screen:
- Associate the "Refuse" intent of the "play" screen with the "farewell" screen:
- Associate the "Farewell" intent of the "play" screen with the "farewell" screen:
- Unclear
We cannot predict all variations of what a user might write. To do this, on block Intents there is an option Any other phrase . Any other phrase is executed when the user wrote something that does not fall into any intent and does not correspond to any button.
- From option Any other phrase of the "let's play again" screen create a new block Text :
Something I didn't understand...
- Let's call this screen:
let's play? incomprehensible
- Let's add block Transition to the "let's play? incomprehensible" screen and link it to the "let's play again" screen.
- From option Any other phrase of the "play" screen create another new block Text *:
Now it was not clear ...
- Let's call this screen:
start? unclear
- Add block Transition to the "start? unclear" screen and link it to the "play" screen.
Now let's refine the variant Any other phrase on the "receiving input" screen. Here we are asking for a number, and Any other phrase can work if the user did not name a number, said something that does not contain a number.
- From Any other phrase of the "receiving input" screen create block Text :
I don't see a number in your answer...
- Let's call this screen:
no number
- Let's add block Transition to the "no number" screen and link it to the "name the number" screen.
- Associate intent Agreement of the "accept input" screen with the "say a number" screen.
- Add block Intents 9 to the farewell screen0005 , create an intent, copy and paste into it:
* *game* *
This screen will accept user responses such as "let's play", "play some more", "let's play", "let's play", "let's play again", "play again", etc.
- Associate intent
* *games* *
with the request screen.
- Associate variant Any other phrase of the "farewell" screen with the "play" screen.
- Add a button to the farewell screen:
play
-
Associate intent Welcome from the "receiving input" screen with the "welcome" screen.
-
We will finalize the intents
To make the bot's reactions more lively, we can add additional intents.
- For example, on the screen "play" intent Consent we can add the following intent:
* *games* *
Then if the user writes "well, let's play", the bot will also recognize it as consent.
- Intent Failure on the "play" screen, you can add an intent:
* not * *games* *
This intent can accept phrases such as "I don't want to play", "I won't play", etc.
In the process of testing the bot, you can find the "blind spots" of the bot and add the necessary intents to the script.
Done!
Scenario ready.
Total:
In this lesson we learned how to operate Aimylogic basic blocks to create talking bots
What's next?
You can publish the bot to a channel, for example
- on VKontakte
- to Alice
- or Telegram
- Also, you can place the bot on your site or connect to another channel.
Publishing in channels may require work, but tips are described in the relevant channel articles. :)
"guess the number" in python with 3 best scores recorded
need to make a "guess the number" game with 3 best scores recorded in file. moreover, if a player with his result is in the top 3, he must enter his name, and it should be displayed in the file as follows:
Player1 - 1 attempt Player2 - 2 attempts, etc.
while there is such a piece of code
rand_num = random.choice(rand_num_list) attempts = 0 import random import pickle rand_num_list = [1, 2, 3, 4, 5] rand_num = random.choice(rand_num_list) attempts = 0 # uncomment these lines to create a file # file = open("highScores.txt", "wb") # file.close() answer = int(input("Guess the number: ")) if answer == rand_num: attempts += 1 print("Guessed") print(f'You took {attempts} tries') elif answer < rand_num: print("The number is too small") attempts += 1 elif answer > rand_num: print("The number is too big") attempts += 1
- python
2
Add the following code:
file = open("highScores.