0% found this document useful (0 votes)
18 views3 pages

Tamil Selvan (Number Gussing Program)

Uploaded by

sokkanathankmc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Tamil Selvan (Number Gussing Program)

Uploaded by

sokkanathankmc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

NUMBER GUESSING GAME DOCUMENTATION

INDEX

Problem Definition1.1 Introduction


1.2 Features
Problem Analysis2.1 Existing System
2.2 Proposed System
2.3 List of Modules
2.4 Module Description
2.5 List of Tables
2.6 Table Description
3.1Software and Hardware Requirements
3.2Future Enhancements
3.3Source Code
3.4Output
3.5Bibliography
3.6Webliography

1. PROBLEM DEFINITION
1.1 Introduction
The Number Guessing Game is a simple Python-based game where players attempt to guess a randomly
selected number within a specific range. The game offers a user-friendly interface and immediate
feedback, making it suitable for users of all ages.

1.2 Features
Simple Interface: The game operates via text input, ensuring accessibility.
Feedback Mechanism: Players are informed if their guesses are too high or too low.
Randomized Gameplay: Each session generates a new random number.
Score Tracking: Tracks the number of attempts made by the user.
Customizable Range: The number range can be adjusted to vary difficulty.

2. PROBLEM ANALYSIS
2.1 Existing System
Traditional guessing games are often played manually, requiring a moderator to select and keep track of
the target number. Challenges in this approach include:

Lack of impartiality, as the moderator may unintentionally give away hints.


Difficulty in keeping consistent rules across games.
No record of performance for players.
2.2 Proposed System
The Number Guessing Game addresses these issues by automating the game through Python. The
computer randomly selects a number, ensures impartiality, and provides instant feedback, allowing for
seamless and consistent gameplay.

2.3 List of Modules


StartGame()
GetGuess()
ProvideFeedback()
2.4 Module Description
StartGame(): Initializes the game, generates the random number, and starts the loop for user input.
GetGuess(): Accepts the user’s guess and validates it.
ProvideFeedback(): Compares the guess to the target number and gives feedback (too high/low or
correct).
2.5 List of Tables
No database is required for this game.

3. SOFTWARE AND HARDWARE REQUIREMENTS


Hardware Requirements
System: Intel Core i3 or higher
RAM: 4GB or higher
Input Devices: Keyboard
Software Requirements
Operating System: Windows 8/10/11
Programming Language: Python 3.x

4. FUTURE ENHANCEMENTS
Add a graphical user interface (GUI) for an enhanced experience.
Introduce difficulty levels (easy, medium, hard).
Implement a leaderboard to track players’ performance.
Enable multiplayer mode.
Integrate sounds and animations.

5. SOURCE CODE
python
Copy code
import random

def start_game():
print("\nWelcome to the Number Guessing Game!")
print("I have selected a number between 1 and 100. Can you guess it?")
number = random.randint(1, 100)
attempts = 0

while True:
try:
guess = int(input("\nEnter your guess: "))
attempts += 1
if guess < number:
print("Too low! Try again.")
elif guess > number:
print("Too high! Try again.")
else:
print(f"Congratulations! You guessed the number in {attempts} attempts!")
break
except ValueError:
print("Invalid input. Please enter a valid number.")

if __name__ == "__main__":
start_game()

6. OUTPUT
Game Start:
css
Copy code
Welcome to the Number Guessing Game!
I have selected a number between 1 and 100. Can you guess it?
User Input and Feedback:
mathematica
Copy code
Enter your guess: 50
Too low! Try again.

Enter your guess: 75


Too high! Try again.

Enter your guess: 62


Congratulations! You guessed the number in 3 attempts!

7. BIBLIOGRAPHY
Programming in Python by John Zelle
Python Crash Course by Eric Matthes
8. WEBLIOGRAPHY
www.python.org
www.geeksforgeeks.org

You might also like