01 134231 043 106158104668 19062023 012116am
01 134231 043 106158104668 19062023 012116am
2. Team
2.1 Team Members
2.2 Responsibilities
3. Project Management
3.1 Project planning and scheduling
8. Requirement Specification
8.1 Introduction
9. Conclusion
Introduction:
The Hangman Game: A Captivating Challenge of Words!
The Hangman Game is a computer programming project that brings the classic
wordguessing game to life. In this engaging and interactive game, players are tasked
with unraveling hidden words by guessing individual letters. The objective is to
discover the correct letters and complete the word before a hangman is fully drawn,
ultimately challenging players' vocabulary and deductive skills. With its simple yet
addictive gameplay, the Hangman Game offers an exciting opportunity to entertain
and engage users while expanding their knowledge of words. This report will delve
into the development process, features, and functionalities of the Hangman Game,
highlighting its significance as an entertaining and educational computer game.
2. Team:
2.1. Team Members:
The project team will consist of three members:
• Muhammad Abdullah Azib 01-134231-043
• Muhammad Abdullah Masood 01-134231-044
• Muhammad Zohaib 01-134231-070
2.2. Responsibilities:
The responsibilities of each team member are as follows:
1. Project Manager: Manage the project, create the project plan, and coordinate
the activities of team members.
2. Developer: Develop and implement the game logic, and optimize the game's
performance.
Tester: Test the game to ensure that it is free of errors and provides an enjoyable
gaming experience.
3. Project Management:
3.1. Project planning and scheduling:
Project planning
and scheduling were crucial for the successful completion of the Hangman Game
project. A detailed project plan was created, outlining the tasks, milestones, and
timelines for each development phase. This helped in allocating resources effectively
and ensuring that the project progressed smoothly. A Gantt chart was utilized to
visualize the project timeline, monitor progress, and manage dependencies. Regular
team meetings and progress updates ensured effective communication and coordination
among team members.
Week 3: Implement the game logic that allows the user to guess letters and displays the
result on the screen.
Week 4: Implement the scoring system, error handling, multiplayer game, and hints
to help the player.
Week 5: Test and debug the game to ensure that it is free of errors and provides an
enjoyable gaming experience.
4. System Design:
4.1 Introduction:
The system design for the Hangman Game encompasses the overall architecture and
design considerations. The game follows a client-server architecture, where the client
represents the user interface and the server manages the game logic. The design
prioritizes simplicity, user-friendliness, and scalability to accommodate potential
future enhancements. The Hangman Game was developed using an object-oriented
design approach, ensuring modularity and ease of maintenance.
4.2 Implementation:
The implementation of the Hangman Game in C++ involved the use of objectoriented
programming principles to create classes such as HangmanGame and
WordGenerator. The game logic was built around these classes, allowing for word
selection, letter guessing, and scoring. The program utilized standard input/output
streams for user interaction and displayed the hangman figure and partially revealed
word using ASCII art and string manipulation techniques. Error handling
mechanisms were implemented to validate user input and provide appropriate
feedback. Difficulty levels were incorporated, adjusting the word selection based on
the chosen level. Testing and debugging played a vital role in ensuring a bug-free and
enjoyable gaming experience. Overall, the implementation successfully delivered a
captivating and interactive Hangman Game in C++.
Screenshots:
Fig:2:Gameplay.
Fig:4: Lose screen.
5.1. Stakeholders:
The stakeholders involved in the Hangman Game
project include the project team, end-users, and potential clients or sponsors. The
project team consists of developers, designers, and testers who collaborated to bring
the game to life. The end-users are the players who will interact with and enjoy the
Hangman Game. Client or sponsor involvement was limited to providing guidance
and feedback throughout the development process.
and implementing the game logic. The third and the last group member will be
responsible for testing the game to ensure that it is free of errors and provides an
enjoyable gaming experience.
7. Functional Requirements (5):
1. The game must display a set of blank spaces on the screen representing the letters
in the words to be guessed.
2. The user must be able to guess one letter at a time.
3. The game must display the letters that the user has guessed and the remaining
attempts.
4. The game must randomly select a word from a predefined set of words.
5. The game must provide the user with an option to choose the difficulty level.
These functional requirements are essential for the proper functioning of the game
and must be implemented.
Processor: Intel Core i5 to Intel Core i7 8th generation used as a processor because it
provides reliable and stable working and run our pc for long time.
9. Conclusion:
In conclusion, the Hangman Game project has been
successfully developed, meeting the specified requirements and objectives. Through
effective project management, meticulous planning, and a well-designed system, the
team was able to create an engaging and enjoyable game. The game mechanics, user
interface, and difficulty levels provide a satisfying experience for players. Further
enhancements and improvements can be explored to expand the game's features and
reach a wider audience. Overall, the Hangman Game project was a valuable learning
experience, showcasing the team's programming skills and project management
capabilities.
Code:
#include <iostream>
#include <cstdlib>
#include<vector>
#include <ctime>
int numWords;
string* wordArray;
switch (level) {
case 1:
numWords = sizeof(easyWords) / sizeof(easyWords[0]);
wordArray = easyWords;
break;
case 2:
numWords = sizeof(mediumWords) / sizeof(mediumWords[0]);
wordArray = mediumWords;
break;
case 3:
numWords = sizeof(hardWords) / sizeof(hardWords[0]);
wordArray = hardWords;
break;
default:
cout << "Invalid level. Setting to easy." << endl;
numWords = sizeof(easyWords) / sizeof(easyWords[0]);
wordArray = easyWords;
break;
}
srand(time(0));
int Index = rand() % numWords;
string word = wordArray[Index];
return word;
}
void welcome() {
cout << "\033[1;31m";
cout << " _ _
\n";
cout << " | | | |
\n";
cout << " | |__| | __ _ _ __ __ _ _ __ ___ __ _ _ __
\n";
cout << " | __ |/ ` | ' \\ / ` | ' ` _ \\ / ` | ' \\ \n";
cout << " | | | | (_| | | | | (_| | | | | | | (_| | | | |
\n";
cout << " |_| |_|\\__,_|_| |_|\\__, |_| |_| |_|\\__,_|_| |_|
\n";
cout << " _/ |
\n";
cout << " |___/
\n";
return guess;
}
void misse(int misses)
{
if (misses == 1)
{
}
else if (misses == 2)
{
}
else if (misses == 3)
{
}
else if (misses == 4)
{
}
else if (misses == 5)
{
}
else if (misses == 6)
{
}
void status(vector<char>incorrect, string guessword)
{
if (guessword == word)
{
//cout << "\033[1;33m";
system("color 05");
cout << " Hooray! You won\n";
//cout << "
Congratulations!\n";
cout << " ,. ,. ,.\n";
cout << " || || || ()\n";
cout << " ,--. ,-. ,.,-. ,--.,.,-. ,-. ||-.,. ,.|| ,-. ||-.,. ,-. ,.,-. ,--.\n";
cout << "//`-'//-\\\\||/|| //-||||/`'//-\\\\ ||-'|| ||||//-\\\\ ||-'||//-\\\\||/||
((`-'\n";
cout << "|| || |||| |||| |||| || || || || /|||||| || || |||| |||| || ``.\n";
cout << "\\\\,-.\\\\-//|| || \\\\-.|||| \\\\-|| || ||//||||\\\\-|| || ||\\\\-//||
|| ,-.))\n";
cout << " `--' `-' `' `' `-,|`' `-^-``' `-' `'`' `-^-``' `' `-' `' `' `--'\n";
cout << " // .--------.\n";
cout << " ,-.// .: : : :___`.\n";
cout << " `--' .'!!::::: \\\\\\_ `.\n";
cout << " : . /%O!!::::::::\\\\_\\. \\\n";
cout << " [\"\"]/%%O!!::::::::: : . \\\n";
cout << " | |%%OO!!::::::::::: : . |\n";
cout << " | |%%OO!!::::::::::::: :|\n";
cout << " : .'--`.%%OO!!:::::::::::: :|\n";
cout << " : .: /`.__.'\\%%OO!!::::::::::::/\n";
cout << " : . / \\%OO!!!!::::::::::/\n";
cout << " ,-'``'-. ; ;%%OO!!!!!!:::::'\n";
cout << " |`-..-'| | ,--. |`%%%OO!!!!!!:'\n";
cout << " | . :| |_.','`.`._| `%%%OO!%%'\n";
cout << " | . : | |--' `--| `%%%%'\n";
cout << " |`-..-'| || | | | | /__\\`-.\n";
cout << " \\::::::/ ||)|/|)|)|\\| /\n";
cout << "---------`::::'--|._ ~**~ _.|----------( -----------------------\n";
cout << " )( | `-..-' | \\ ______\n";
cout << " )( | |,--. ____/ / /\\\\ ,-._.-'\n";
cout << " ,-')('-. | |\\`;/ .-()___ : |`.!,-'`'/`-._\n";
cout << " ( ' ` )`-._ _.-'|;,| `-, \\_\\__\\`,-'>-.,-._\n";
cout << " `-....-' ```` `--' `-._ (`- `-._`-. 5\n";
//cout << "\033[0m";
}
else
{
system("color 04");
//cout << "\033[1;31m";
cout << " +-------------------+ \n";
cout << " | | \n";
cout << " | | \n";
cout << " | | \n";
cout << " (-_-) | \n";
cout << " | | \n";
cout << " /|\\ | \n";
cout << " / | \\ |\n";
cout << " | | \n";
cout << " | | \n";
cout << " / \\ | \n";
cout << " / \\ | \n";
cout << " | \n";
cout << " | \n";
cout << " ====================== \n";
cout << "\n\n\n";
int main() {
int level;
int misses = 0;
char letter;
vector<char>incorrect;
welcome();
status(incorrect, guessword);
incorrect.push_back(letter);
misses++;
}
guess = false;
}
end_game(guessword, word);
return 0;
}