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

Number Guessing Game Project Report

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)
18 views8 pages

Number Guessing Game Project Report

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

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++] ([Link]


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

Common questions

Powered by AI

Randomness contributes significantly to the gameplay experience of the "Number Guessing Game" by introducing unpredictability, which keeps the game challenging and engaging. The project uses random number generation to create the target number that players must guess, ensuring that each game is unique. This was implemented through standard C++ functions dedicated to random number generation, ensuring fairness and variability in gameplay .

The scoring system in the "Number Guessing Game" is designed to balance reward and difficulty by deducting points for each incorrect guess and additional penalties when players opt to use hints. This design encourages players to make informed and careful guesses to preserve their score, thus maintaining a challenging and rewarding gameplay environment. It promotes strategic thinking by incentivizing efficiency and minimizing reliance on hints, thereby balancing engagement and challenge .

The potential improvements suggested for the future development of the "Number Guessing Game" include enhancing the hint mechanism by introducing range narrowing hints, transitioning to a graphical user interface (GUI) for broader accessibility, implementing a leaderboard system to record high scores, and offering advanced difficulty customization settings like allowing players to select their attempt limits or number ranges .

The feedback mechanism in the "Number Guessing Game" provides players with information on how close their guess is to the correct number. This system is vital for player engagement as it guides the players, making the game more interactive and dynamic. It helps maintain players' interest by offering clues that facilitate progress, thereby promoting a learning environment where players can refine their guessing strategies .

Real-time validation is crucial in the "Number Guessing Game" as it ensures that the inputs provided by players are processed and responded to immediately, which enhances the game's interactivity. This feature helps prevent errors, guides players through correct inputs, and improves the overall gaming experience by maintaining an intuitive interface and gracefully handling invalid inputs, ensuring smooth gameplay .

The introduction of difficulty levels in the "Number Guessing Game" enhances its educational potential by catering to different skill levels and promoting gradual learning progressions. The varying levels of challenge teach players about probability, logic, and deductive reasoning. Players can start at an easy level to learn basic concepts and progress to more challenging levels as their skills improve, thus providing a structured learning path that encourages cognitive development through gameplay .

Implementing a class-based structure in the "Number Guessing Game" provides several advantages such as modularity, encapsulation, and reusability. It allows for organizing game logic into manageable sections, makes the codebase easier to understand, maintain, and extend, and encapsulates the game's functionality, which ensures that all necessary operations related to game management, such as setting difficulty, generating random numbers, and handling player input, are well-contained and easily manageable .

The "Number Guessing Game" project differentiates itself by incorporating differentiated difficulty levels, a scoring system, and a feedback mechanism that provides feedback based on how close the guess is to the target number. Unlike traditional games that do not adjust difficulty or offer detailed feedback, this project includes three levels of difficulty (Easy, Medium, Hard) and a scoring system that deducts points for wrong guesses and usage of hints, enhancing player engagement .

The critical design flow steps in ensuring the success of the "Number Guessing Game" involved initializing the game to set difficulty and variables, processing player input efficiently, employing a feedback mechanism to evaluate guess proximity, and updating scores based on attempts and hint usage. These steps were crucial in providing a seamless and engaging user experience, as they systematically addressed key game functions and included provisions for handling invalid inputs and improving player interaction .

Providing accurate and meaningful feedback in game design, such as in the "Number Guessing Game," involves ensuring that the feedback is neither too vague nor too explicit, which could reduce the challenge. The feedback must be relevant to the game's objectives, guiding players effectively without giving away solutions. The challenge lies in balancing the difficulty and maintaining player motivation by ensuring feedback is perceived as helpful rather than frustrating .

You might also like