Guessing Number Game
Guessing Number Game
1. Abebe Berhanu…………………………………………………R/ET-5378/09
4. Mohammed Shemsu……………………………………………...R/ET-5836/09
5. Biruk Mitiku………………………………………………………R/ET-5532/09
January, 2020
Hosanna, Ethiopia
Table of Contents
1. Introduction...........................................................................................................................3
2. Statement of the problem which include the Steps of problem solving (such as Goal
formulation, Problem formulation, Search, and Execute/ Solution)...........................................3
2.3 Search............................................................................................................................3
2.4 Execute..........................................................................................................................3
4. Related works.......................................................................................................................4
5.1 The brief descriptions of your system’s PAGE (Percepts, Actions, Goals, and
Environment)...........................................................................................................................4
5.2 The brief descriptions of your system’s PEAS (Performance measure, Environment,
Actuators, and Sensors)...........................................................................................................5
7. References.............................................................................................................................6
Page | 2
1. Introduction
The program will select a number between some range of integer numbers, then the user will
keep making guesses of what the number is until the numbers match in a given number of
chances. If the guess is incorrect, then the program tells the user whether the guess was higher or
lower than the selected integer number and reduces the number of chances of a guess. The user
wins the game if he/she gets the correct answer before number of chances come to end
otherwise, he/she loses.
2.3 Search
- average of numbers from guessed and told to guess
2.4 Execute
- entering the average numbers
Page | 3
4. Related works
The game is two-person game called "Guess the Number". The first player thinks of an integer
within a known range. The second player tries to guess the number. If the guess is incorrect, then
the first player tells the second player whether the guess was too high or too low. Eventually, the
second player guesses the correct number. The second player's score equals the number of
guesses he made. The players then reverse their roles and repeat the game. The winner is the
player who gets the correct answer with the fewest guesses.
The key strategy in this game is to generate a clever guess. If, for example, the second player
knows the number is between 0 and 100, then a reasonable first guess is 50. This choice evenly
splits the range, giving you the maximum amount of information about the next guess. If the first
player says the guess is too low, then the second player splits the reduced range and guesses 75.
If the player says the guess is too high, then the optimal guess is 25. It can be shown that by
splitting the remaining range in half after each guess, it will, at worst, take the second player no
more than guesses to find the unknown number where is the initial range. So, if the
unknown number lies between 0 and 7, then it can be guessed in no more than
guesses[ CITATION 20Ja1 \l 1033 ].
Page | 4
measure
Guessing Exactly equal to Computer, Arm, Mouse Keyboard,
number game the selected Game player Screen
random number
7. References
Page | 5
[2] 10 January 2020. [Online]. Available: https://github.com/hardikvasa/guess-the-number-
game.
def main():
game()
while True:
another_game = input("Do you wish to play again?(y/n): ")
Page | 7
if another_game == "y":
game()
else:
break
main()
print("\nEnd of the Game! Thank you for playing!")[ CITATION 20Ja2 \l 1033 ].
Page | 8