ABSTRACT:
A Number Guessing Game is a simple interactive program
where the user tries to guess a randomly generated number
within a given range. The system provides hints such as
“Too High” or “Too Low” to guide the user toward the
correct answer.
This project demonstrates the use of basic programming
concepts like loops, conditional statements, random
number generation, and user input handling. It helps
improve logical thinking and problem-solving skills while
creating an engaging user experience.
INTRODUCTION:
Games are a fun way to understand programming
concepts. The Number Guessing Game is one such
beginner-friendly project that introduces interaction
between the user and the system.
The program generates a random number, and the player
must guess it within a limited number of attempts.
Feedback is provided after each guess to help the player
improve their next attempt.
This project helps in understanding control structures,
loops, and basic algorithms used in real-world
applications.
HARDWARE–SOFTWARE
REQUIREMENTS:
Hardware Requirements:
Processor: Intel Core i3 or higher
RAM: Minimum 4 GB
Storage: 100 MB free space
Keyboard & Mouse
Power Supply: 230V AC
Software Requirements:
Operating System: Windows / Linux
Programming Language: Python
IDE: VS Code / PyCharm / IDLE
ARCHITECTURE DIAGRAM:
MODULES AND THEIR
DESCRIPTION:
1. Input Module:
Accepts the user’s guessed number and ensures it is
within the valid range.
2. Random Number Generator Module:
Generates a random number using built-in functions.
3. Comparison Module:
Compares the user’s guess with the actual number.
4. Hint Module:
Displays hints like “Too High” or “Too Low”.
5. Attempt Counter Module:
Tracks the number of attempts taken by the user.
6. Result Display Module:
Displays success message when the correct number
is guessed.
CODING (PYTHON):
import random
number = [Link](1, 100)
attempts = 0
print("Welcome to Number Guessing Game!")
print("Guess a number between 1 and 100")
while True:
guess = int(input("Enter your guess: "))
attempts += 1
if guess < number:
print("Too Low!")
elif guess > number:
print("Too High!")
else:
print("Correct! You guessed it in", attempts,
"attempts.")
break
OUTPUT SCREENSHOT:
CONCLUSION:
The Number Guessing Game successfully demonstrates
basic programming concepts such as loops, conditionals,
and random number generation. It provides an interactive
way to understand user input handling and logical
decision-making.
This project can be enhanced further by adding difficulty
levels, score tracking, time limits, and graphical interfaces
to improve user experience.