0% found this document useful (0 votes)
10 views

Dsa Project

Uploaded by

dharahaasa03
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)
10 views

Dsa Project

Uploaded by

dharahaasa03
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/ 8

Number Guessing Game

A PROJECT REPORT

Submitted by

Mankaran Singh Tandon (23BCS10204)


Abbadasari Dharahaas (23BCS10186)
Kritarth Kashyap (23BCS10189)
Priyanshu Anand (23BCS10203)
Tanushree Debta (23BCS10209)

in partial fulfillment for the award of the degree of

BACHELOR OF ENGINEERING
IN

COMPUTER SCIENCE & ENGINEERING

Chandigarh University

November, 2024

1
TABLE OF CONTENTS

CHAPTER 1. INTRODUCTION ....................................................................... 3


1.1. Introduction to Project ................................................................................................... 3

1.2. Identification of Problem ............................................................................................... 3

CHAPTER 2. BACKGROUND STUDY ........................................................... 3


2.1. Existing solutions .......................................................................................................... 3

2.2. Problem Definition ........................................................................................................ 4

2.3. Goals/Objectives ........................................................................................................... 4

CHAPTER 3. DESIGN FLOW/PROCESS ....................................................... 4


3.1. Evaluation & Selection of Specifications/Features ......................................................... 4

3.2. Analysis of Features and finalization subject to constraints ............................................ 5

3.3. Design Flow .................................................................................................................. 5


CHAPTER 4. RESULTS ANALYSIS AND VALIDATION ............................ 6
4.1. Implementation of solution ............................................................................................ 6

CHAPTER 5. CONCLUSION AND FUTURE WORK ................................... 6


5.1. Conclusion .................................................................................................................... 6

5.2. Future work................................................................................................................... 7

REFERENCES …………………………………………………………………….7

2
R

CHAPTER 1. INTRODUCTION

1.1. Introduction to Project

The "Number Guessing Game" is a console-based project developed in


C++. It provides an interactive platform for users to guess a randomly
generated number within a set number of attempts, based on selected
difficulty levels. The game aims to combine elements of probability with
deductive reasoning and basic programming principles.

1.2. Identification of Problem

The primary goal is to develop a user-friendly game that incorporates logic


and random number generation in an engaging way, challenging players to
guess the correct number in limited attempts while providing feedback to
guide them. The game can serve as an educational tool for learning basic
programming constructs such as loops, conditionals, and functions.

CHAPTER 2. BACKGROUND STUDY

2.1. Existing Solutions

Traditional number-guessing games often use simple implementations


where the player inputs numbers without specific difficulty levels, limited
feedback, or scoring systems. Existing games typically lack flexibility in
adjusting parameters like attempt limits or score deduction.

3
R

2.2. Problem Definition

To enhance engagement, this project introduces different difficulty levels,


a scoring system, and a feedback mechanism based on the proximity of
guesses to the target number. This allows players to experience varying
levels of challenge and enjoy a more dynamic gameplay experience.

2.3. Goals/Objectives

1. Create an interactive number-guessing game with three difficulty


levels (Easy, Medium, Hard).
2. Provide feedback based on the closeness of the player’s guess to the
correct number.
3. Implement a scoring system that penalizes for each incorrect guess,
with additional penalties for hints if utilized.
4. Enable hints and feedback for players to make informed guesses.

CHAPTER 3. DESIGN FLOW/PROCESS

3.1. Evaluation & Selection of Specifications/Features

The game’s core features include:


1. Random number generation: Ensures unpredictability for each
gameplay.
2. Difficulty levels: Defines max attempts and number range for Easy,
Medium, and Hard levels.

4
R

3. Score deduction and feedback: Gradually reduces the score based


on the number of attempts and the usage of hints.
4. Hint mechanism: Optional hints indicating if the number is higher or
lower than the last guess.

3.2. Analysis of Features and Finalization Subject to


Constraints

Each feature was evaluated for relevance and simplicity, with final
selections aimed at enhancing player engagement without overly
complicating gameplay. Constraints include limiting guesses based on
difficulty level and ensuring feedback is accurate and meaningful.

3.3. Design Flow

1. Initialize Game: Set difficulty and initialize game variables.


2. Input Processing: Accept guess input from the player.
3. Feedback Mechanism: Evaluate guess proximity and provide
feedback.
4. Scoring: Update score based on attempts and hint usage.
5. Game End: Display results and offer replay options.

5
R

CHAPTER 4. RESULTS ANALYSIS AND


VALIDATION

4.1. Implementation of Solution

The Number Guessing Game was implemented using C++ and includes:
 A class-based structure for game management.
 Functions for setting difficulty, generating random numbers, handling
player input, providing feedback, and updating scores.
 Real-time validation ensures that players can interact intuitively and
that the game handles invalid input gracefully.
Testing showed the program operates as intended across different
difficulty levels, with accurate scoring and consistent feedback. The
game successfully adapts to player inputs and provides an interactive,
challenging experience.

CHAPTER 5. CONCLUSION AND FUTURE


WORK

5.1. Conclusion

The Number Guessing Game is a functional C++ console application that


integrates user interactivity with basic programming constructs. It
successfully provides varying levels of challenge and encourages logical
reasoning. The project demonstrates principles of game design, random
number generation, and class-based programming in C++.

6
R

5.2. Future Work

Potential improvements include:


1. Enhanced Hint Mechanisms: Introduce hints based on range
narrowing to guide players better.
2. Graphical User Interface (GUI): Transition to a GUI for broader
accessibility.
3. Leaderboard: Implement a leaderboard system to record high scores.
4. Advanced Difficulty Settings: Customize difficulty further by
allowing players to select their own attempt limits or number ranges.

References

1. [Random Number Generation in C++] (https://www.learn.in)


LearnCPP, 2024.
2. Usability Guidelines in Game Design - Gamasutra, 2023.
3. Principles of User Interaction Design - Nielsen Norman Group, 2023.
4. Effective Scoring Systems for Educational Games - EdTech
Magazine, 2023.
5. Randomness and Its Applications in Game Design - Game Design
Journal, 2023.
6. Advanced Game Feedback Techniques - Gamasutra, 2024.

7
R

SCREENSHOT

You might also like