SlideShare ist ein Scribd-Unternehmen logo
1 von 7
National University of Sciences and Technology (NUST)
School of Electrical Engineering and Computer Science
_____________________________________________________________________________________
CS250: Data Structures and Algorithms
Project Final Report
Evil Hangman
Class: BEE5 - B
Members:
 HassanSaeed (5718)
 Taimoor Tahir (4628)
Submitted to: Sir.Asad Waqar
National University of Sciences and Technology (NUST)
School of Electrical Engineering and Computer Science
_____________________________________________________________________________________
Evil Hangman
Abstract:
Evil Hangman is a game that cheats at the classic game Hangman. Normally, when writing a
computer to play Hangman, the computer picks a single word and accurately represents it as
the human player tries to guess all of the letters in the word. In Evil Hangman, the computer
instead maintains a list of every word in the English language, then continuously cuts down the
word list to try to dodge the player's guesses as much as possible.
Introduction:
The basic purpose of the program was to renew the conventional game of Hangman so that it
become almost impossible for the player to win. That game was played in a way that a word
was given to the player of specific length. Then the player guesses the word by hit and trial and
by his/her own knowledge. As the player guesses the word by guessing its alphabets he/she
wins. Now, the game has changed in such a way that the difficulty of the game is enhanced by
90%. In this game instead of a single word there is a whole list of possible words of the length
as per selected by the player. So, depending upon the guesses the program changes the word in
such a way that it became least probable for the player to win unless there is one and only one
word is possible in the list.
Now, it is not easy to synthesize a program like this because the words have to be checked
again and again. So, a really efficient program is not easy to write for this using simple arrays.
For this purpose in this program linked list is used with various helping functions. The details of
these functions and the working along with the way of programing is given under the heading
of implementation.
National University of Sciences and Technology (NUST)
School of Electrical Engineering and Computer Science
_____________________________________________________________________________________
Implementation:
This program is implemented in such a way that its efficiency would not be ignored. So. The
program is implemented using linked list and various different helping functions in its linked list
class.
Firstly the player chooses the difficulty level. This is done by inserting the length of the word
and the number of guesses he/she wants. Then the program checks whether any word of the
given word length is present in the program or not. If there is, then it continues or if not, then it
asks again.
After selecting the difficulty level the program inserts all the words of the length given by the
player into a linked list by reading from the dictionary. Now all the possible word of a specific
length are present in a linked list.
In the next step the player is then asked for the word he/she wants to insert to play the game.
As the user inserts the alphabet in the program a check (bool) function checks the list if that
specific alphabet is present in all the words or not. If that alphabet is not present in every word
of the list then it removes all the words in the list that include this alphabet. This is done with
help of search and remove (void) function, which checks for a specific letter in all the words
present in the list to remove the words from the list in case of presence of that letter entered
by the player. If the alphabet is present in every word of the list then it places the word on the
same position as it is placed in the first word of the list and remove all the other words from the
list where that alphabet is not present at the specific position as in the first alphabet of the list.
This done with the help of remove other (void) and insert (void) function. First function checks
all the words in the list letter by letter for the alphabet entered by the player and its position, if
that specific letter is present at the same position as in the first word then it is not removed
else the word is removed from the list. While the second function helps to place the letter in
the word at its specific position in a string to display the word on the screen.
Same procedure continues till the player ran out of guesses or succeed in guessing the word.
When only one word remains in the list the game executes same as the old conventional
Hangman game. If the player was unable to guess the word then a list of all the words together
with a loss message and amount of words possible is displayed on the screen. If the player
succeed to win then a congratulatory message appears at the screen. At the end the game asks
the player that if he/she want to play again or not.
This is the table of the functions used in the linked list class.
National University of Sciences and Technology (NUST)
School of Electrical Engineering and Computer Science
_____________________________________________________________________________________
Functions Name Purpose
void insert(string str) //For inserting a word into linked list
void remove(string str) //For removing a word from the linked list
void SearchAndRemove(char c) //For removing all the words from the
linked list having a specific alphabet
int length() //For measuring the number of words in the
linked list
void display() //For displaying all the words in the
linked list
bool check(char c) //For checking if a spcific alphabet is
present in all the words of the linked
list
void RemoveOther(char c) //For removing all the words which do not
have a specific letter at specific
positions
string place(char c) //For placing an alphabet at it's position
in the word
National University of Sciences and Technology (NUST)
School of Electrical Engineering and Computer Science
_____________________________________________________________________________________
Results:
Below are a fewsamplesof the workingof the program
Sample run: Result Lost
National University of Sciences and Technology (NUST)
School of Electrical Engineering and Computer Science
_____________________________________________________________________________________
Sample run: Result Win
National University of Sciences and Technology (NUST)
School of Electrical Engineering and Computer Science
_____________________________________________________________________________________
If a letter, already used, is entered again, an error is generated saying “You have already used
this word”. Although number of guesses remains the same.
Discussionand Conclusion:
Overall the game wasnot easyto program.There were a lotof problemsinitiallyandduringthe later
phasesof the program. Once,we understoodthe logicandmade a comprehensive flow chartof our
program inour mindsitbecame a biteasy.At laterstageswe have to come up withdifferentideasto
solve ourproblemsfordifferentstepsof our programwithdeepthinking.We applieddifferentlogicsto
performspecifictasksinthis waywe proceedtoour code by editing,changing andvarying.We alsotook
helpfromvariouswebsitesforsyntax issuesandvariousotherissuesespeciallyregardingstringsto
performdifferentfunctionsonwords,whichwere inthe formof strings.Atlastafterall the effortand
hard workwe succeededinmakingagreat program, whichwe enjoyedalot.

Weitere ähnliche Inhalte

Was ist angesagt?

Tic tac toe c++ programing
Tic tac toe c++ programingTic tac toe c++ programing
Tic tac toe c++ programingKrishna Agarwal
 
Game Development Step by Step
Game Development Step by StepGame Development Step by Step
Game Development Step by StepBayu Sembada
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsMukesh Kumar
 
Word practical questions for exercises
Word practical questions for exercisesWord practical questions for exercises
Word practical questions for exercisesHari993901
 
Software Engineer- A unity 3d Game
Software Engineer- A unity 3d GameSoftware Engineer- A unity 3d Game
Software Engineer- A unity 3d GameIsfand yar Khan
 
Social Games in China - The New Import/Export Business!
Social Games in China - The New Import/Export Business!Social Games in China - The New Import/Export Business!
Social Games in China - The New Import/Export Business!James Gwertzman
 
Project presentation FPS
Project presentation FPSProject presentation FPS
Project presentation FPSShubham Rajput
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentationSaad Symbian
 
basic shortcut keys in computer
basic shortcut keys in computerbasic shortcut keys in computer
basic shortcut keys in computerHirfan Ullah
 
Introduction to Game Development
Introduction to Game DevelopmentIntroduction to Game Development
Introduction to Game DevelopmentSumit Jain
 
Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Vasilis Kamakaris
 
Final Year Game Project Report - Riko: The Aventurer
 Final Year Game Project Report - Riko: The Aventurer  Final Year Game Project Report - Riko: The Aventurer
Final Year Game Project Report - Riko: The Aventurer Nusrat Jahan Shanta
 
Gender Inequality in Bangladesh
Gender Inequality in BangladeshGender Inequality in Bangladesh
Gender Inequality in BangladeshMaruf Hussain
 
Game development
Game developmentGame development
Game developmentRareCoders
 
Introduction to Game Development
Introduction to Game DevelopmentIntroduction to Game Development
Introduction to Game DevelopmentShaan Alam
 

Was ist angesagt? (20)

Tic tac toe c++ programing
Tic tac toe c++ programingTic tac toe c++ programing
Tic tac toe c++ programing
 
logic gates By ZAK
logic gates By ZAKlogic gates By ZAK
logic gates By ZAK
 
Control flow Graph
Control flow GraphControl flow Graph
Control flow Graph
 
Game Development Step by Step
Game Development Step by StepGame Development Step by Step
Game Development Step by Step
 
A complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projectsA complete introduction on matlab and matlab's projects
A complete introduction on matlab and matlab's projects
 
Scratch Programming
Scratch ProgrammingScratch Programming
Scratch Programming
 
Word practical questions for exercises
Word practical questions for exercisesWord practical questions for exercises
Word practical questions for exercises
 
Software Engineer- A unity 3d Game
Software Engineer- A unity 3d GameSoftware Engineer- A unity 3d Game
Software Engineer- A unity 3d Game
 
Social Games in China - The New Import/Export Business!
Social Games in China - The New Import/Export Business!Social Games in China - The New Import/Export Business!
Social Games in China - The New Import/Export Business!
 
Project presentation FPS
Project presentation FPSProject presentation FPS
Project presentation FPS
 
Tic tac toe c++ project presentation
Tic tac toe c++ project presentationTic tac toe c++ project presentation
Tic tac toe c++ project presentation
 
Islam Aur Musalman Urdu Hindi Enghlish.pdf
Islam Aur Musalman Urdu Hindi Enghlish.pdfIslam Aur Musalman Urdu Hindi Enghlish.pdf
Islam Aur Musalman Urdu Hindi Enghlish.pdf
 
basic shortcut keys in computer
basic shortcut keys in computerbasic shortcut keys in computer
basic shortcut keys in computer
 
Introduction to Game Development
Introduction to Game DevelopmentIntroduction to Game Development
Introduction to Game Development
 
Endless runner game in unreal engine 4
Endless runner game in unreal engine 4Endless runner game in unreal engine 4
Endless runner game in unreal engine 4
 
Final Year Game Project Report - Riko: The Aventurer
 Final Year Game Project Report - Riko: The Aventurer  Final Year Game Project Report - Riko: The Aventurer
Final Year Game Project Report - Riko: The Aventurer
 
MS Word 2007
MS Word 2007MS Word 2007
MS Word 2007
 
Gender Inequality in Bangladesh
Gender Inequality in BangladeshGender Inequality in Bangladesh
Gender Inequality in Bangladesh
 
Game development
Game developmentGame development
Game development
 
Introduction to Game Development
Introduction to Game DevelopmentIntroduction to Game Development
Introduction to Game Development
 

Andere mochten auch

Dave's_CurriculumVitae_2015
Dave's_CurriculumVitae_2015Dave's_CurriculumVitae_2015
Dave's_CurriculumVitae_2015Dave Jackson
 
Continuous improvement engineer performance appraisal
Continuous improvement engineer performance appraisalContinuous improvement engineer performance appraisal
Continuous improvement engineer performance appraisalBritneySpears999
 
Construction safety manager performance appraisal
Construction safety manager performance appraisalConstruction safety manager performance appraisal
Construction safety manager performance appraisalBritneySpears999
 
Treinamento em compostagem
Treinamento em compostagemTreinamento em compostagem
Treinamento em compostagemHiram Sartori
 
AC to DC Converter - Product Information Guide
AC to DC Converter - Product Information GuideAC to DC Converter - Product Information Guide
AC to DC Converter - Product Information GuideBlacsyn
 
Pantallazo de cris
Pantallazo de crisPantallazo de cris
Pantallazo de criskimberlin172
 
pantallazo sexto semestre
pantallazo sexto semestrepantallazo sexto semestre
pantallazo sexto semestrekimberlin172
 
Diagnóstico sobre resíduos da construção civil
Diagnóstico sobre resíduos da construção civilDiagnóstico sobre resíduos da construção civil
Diagnóstico sobre resíduos da construção civilHiram Sartori
 
Olagunju pp presentation states of matter
Olagunju pp presentation states of matterOlagunju pp presentation states of matter
Olagunju pp presentation states of matterfunkeolagunju
 
Cach go tieng viet co dau tren HTKK
Cach go tieng viet co dau tren HTKKCach go tieng viet co dau tren HTKK
Cach go tieng viet co dau tren HTKKUnikey
 

Andere mochten auch (13)

Dave's_CurriculumVitae_2015
Dave's_CurriculumVitae_2015Dave's_CurriculumVitae_2015
Dave's_CurriculumVitae_2015
 
Continuous improvement engineer performance appraisal
Continuous improvement engineer performance appraisalContinuous improvement engineer performance appraisal
Continuous improvement engineer performance appraisal
 
Construction safety manager performance appraisal
Construction safety manager performance appraisalConstruction safety manager performance appraisal
Construction safety manager performance appraisal
 
RLSkowronski, 06262015
RLSkowronski, 06262015RLSkowronski, 06262015
RLSkowronski, 06262015
 
Treinamento em compostagem
Treinamento em compostagemTreinamento em compostagem
Treinamento em compostagem
 
AC to DC Converter - Product Information Guide
AC to DC Converter - Product Information GuideAC to DC Converter - Product Information Guide
AC to DC Converter - Product Information Guide
 
Sunita rawat
Sunita rawatSunita rawat
Sunita rawat
 
Pantallazo de cris
Pantallazo de crisPantallazo de cris
Pantallazo de cris
 
pantallazo sexto semestre
pantallazo sexto semestrepantallazo sexto semestre
pantallazo sexto semestre
 
Diagnóstico sobre resíduos da construção civil
Diagnóstico sobre resíduos da construção civilDiagnóstico sobre resíduos da construção civil
Diagnóstico sobre resíduos da construção civil
 
Olagunju pp presentation states of matter
Olagunju pp presentation states of matterOlagunju pp presentation states of matter
Olagunju pp presentation states of matter
 
Cach go tieng viet co dau tren HTKK
Cach go tieng viet co dau tren HTKKCach go tieng viet co dau tren HTKK
Cach go tieng viet co dau tren HTKK
 
Pantallazo mau
Pantallazo mauPantallazo mau
Pantallazo mau
 

Ähnlich wie Evil Hangman report

CS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docxCS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docxfaithxdunce63732
 
Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...IOSR Journals
 
Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...IOSR Journals
 
Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)Muhammed Thanveer M
 
Excel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment mejoney4
 
Western Oregon University Page 1 of 2 CS-161.docx
 Western Oregon University            Page 1 of 2 CS-161.docx Western Oregon University            Page 1 of 2 CS-161.docx
Western Oregon University Page 1 of 2 CS-161.docxaryan532920
 
CS10 Python Programming Homework 4 40 points Lists, Tupl.docx
CS10 Python Programming Homework 4 40 points Lists, Tupl.docxCS10 Python Programming Homework 4 40 points Lists, Tupl.docx
CS10 Python Programming Homework 4 40 points Lists, Tupl.docxmydrynan
 
IT Skill Lab Manual 20CS01P.pdf
IT Skill Lab Manual 20CS01P.pdfIT Skill Lab Manual 20CS01P.pdf
IT Skill Lab Manual 20CS01P.pdfTHANMAY JS
 
Assignment 4
Assignment 4Assignment 4
Assignment 4SneaK3
 
Cognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & SyntaxCognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & SyntaxBryan L. Mack
 
CSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docx
CSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docxCSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docx
CSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docxfaithxdunce63732
 
Analysis of sms feedback and online feedback using sentiment analysis for ass...
Analysis of sms feedback and online feedback using sentiment analysis for ass...Analysis of sms feedback and online feedback using sentiment analysis for ass...
Analysis of sms feedback and online feedback using sentiment analysis for ass...eSAT Journals
 
ONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATION
ONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATIONONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATION
ONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATIONcscpconf
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional arrayRajendran
 
Etech. mitch. [autosaved]
Etech. mitch. [autosaved]Etech. mitch. [autosaved]
Etech. mitch. [autosaved]MaridelBajeta
 

Ähnlich wie Evil Hangman report (20)

CS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docxCS 107 – Introduction to Computing and Programming – Spring 20.docx
CS 107 – Introduction to Computing and Programming – Spring 20.docx
 
Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...
 
Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...Computer aided environment for drawing (to set) fill in the blank from given ...
Computer aided environment for drawing (to set) fill in the blank from given ...
 
Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)Statements,joins and operators in sql by thanveer danish melayi(1)
Statements,joins and operators in sql by thanveer danish melayi(1)
 
Excel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment me
 
Western Oregon University Page 1 of 2 CS-161.docx
 Western Oregon University            Page 1 of 2 CS-161.docx Western Oregon University            Page 1 of 2 CS-161.docx
Western Oregon University Page 1 of 2 CS-161.docx
 
CS10 Python Programming Homework 4 40 points Lists, Tupl.docx
CS10 Python Programming Homework 4 40 points Lists, Tupl.docxCS10 Python Programming Homework 4 40 points Lists, Tupl.docx
CS10 Python Programming Homework 4 40 points Lists, Tupl.docx
 
IT Skill Lab Manual 20CS01P.pdf
IT Skill Lab Manual 20CS01P.pdfIT Skill Lab Manual 20CS01P.pdf
IT Skill Lab Manual 20CS01P.pdf
 
Assignment 4
Assignment 4Assignment 4
Assignment 4
 
Cognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & SyntaxCognos Macros: Situational Examples & Syntax
Cognos Macros: Situational Examples & Syntax
 
Advance excel
Advance excelAdvance excel
Advance excel
 
Chap04
Chap04Chap04
Chap04
 
CSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docx
CSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docxCSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docx
CSE 110 - ASSIGNMENT # 4 – Fall 2015 Due Tuesday Octobe.docx
 
Lk module3
Lk module3Lk module3
Lk module3
 
Interview Preparation
Interview PreparationInterview Preparation
Interview Preparation
 
Analysis of sms feedback and online feedback using sentiment analysis for ass...
Analysis of sms feedback and online feedback using sentiment analysis for ass...Analysis of sms feedback and online feedback using sentiment analysis for ass...
Analysis of sms feedback and online feedback using sentiment analysis for ass...
 
ONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATION
ONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATIONONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATION
ONLINE BANGLA HANDWRITTEN COMPOUND WORD RECOGNITION BASED ON SEGMENTATION
 
E3
E3E3
E3
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Etech. mitch. [autosaved]
Etech. mitch. [autosaved]Etech. mitch. [autosaved]
Etech. mitch. [autosaved]
 

Evil Hangman report

  • 1. National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science _____________________________________________________________________________________ CS250: Data Structures and Algorithms Project Final Report Evil Hangman Class: BEE5 - B Members:  HassanSaeed (5718)  Taimoor Tahir (4628) Submitted to: Sir.Asad Waqar
  • 2. National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science _____________________________________________________________________________________ Evil Hangman Abstract: Evil Hangman is a game that cheats at the classic game Hangman. Normally, when writing a computer to play Hangman, the computer picks a single word and accurately represents it as the human player tries to guess all of the letters in the word. In Evil Hangman, the computer instead maintains a list of every word in the English language, then continuously cuts down the word list to try to dodge the player's guesses as much as possible. Introduction: The basic purpose of the program was to renew the conventional game of Hangman so that it become almost impossible for the player to win. That game was played in a way that a word was given to the player of specific length. Then the player guesses the word by hit and trial and by his/her own knowledge. As the player guesses the word by guessing its alphabets he/she wins. Now, the game has changed in such a way that the difficulty of the game is enhanced by 90%. In this game instead of a single word there is a whole list of possible words of the length as per selected by the player. So, depending upon the guesses the program changes the word in such a way that it became least probable for the player to win unless there is one and only one word is possible in the list. Now, it is not easy to synthesize a program like this because the words have to be checked again and again. So, a really efficient program is not easy to write for this using simple arrays. For this purpose in this program linked list is used with various helping functions. The details of these functions and the working along with the way of programing is given under the heading of implementation.
  • 3. National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science _____________________________________________________________________________________ Implementation: This program is implemented in such a way that its efficiency would not be ignored. So. The program is implemented using linked list and various different helping functions in its linked list class. Firstly the player chooses the difficulty level. This is done by inserting the length of the word and the number of guesses he/she wants. Then the program checks whether any word of the given word length is present in the program or not. If there is, then it continues or if not, then it asks again. After selecting the difficulty level the program inserts all the words of the length given by the player into a linked list by reading from the dictionary. Now all the possible word of a specific length are present in a linked list. In the next step the player is then asked for the word he/she wants to insert to play the game. As the user inserts the alphabet in the program a check (bool) function checks the list if that specific alphabet is present in all the words or not. If that alphabet is not present in every word of the list then it removes all the words in the list that include this alphabet. This is done with help of search and remove (void) function, which checks for a specific letter in all the words present in the list to remove the words from the list in case of presence of that letter entered by the player. If the alphabet is present in every word of the list then it places the word on the same position as it is placed in the first word of the list and remove all the other words from the list where that alphabet is not present at the specific position as in the first alphabet of the list. This done with the help of remove other (void) and insert (void) function. First function checks all the words in the list letter by letter for the alphabet entered by the player and its position, if that specific letter is present at the same position as in the first word then it is not removed else the word is removed from the list. While the second function helps to place the letter in the word at its specific position in a string to display the word on the screen. Same procedure continues till the player ran out of guesses or succeed in guessing the word. When only one word remains in the list the game executes same as the old conventional Hangman game. If the player was unable to guess the word then a list of all the words together with a loss message and amount of words possible is displayed on the screen. If the player succeed to win then a congratulatory message appears at the screen. At the end the game asks the player that if he/she want to play again or not. This is the table of the functions used in the linked list class.
  • 4. National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science _____________________________________________________________________________________ Functions Name Purpose void insert(string str) //For inserting a word into linked list void remove(string str) //For removing a word from the linked list void SearchAndRemove(char c) //For removing all the words from the linked list having a specific alphabet int length() //For measuring the number of words in the linked list void display() //For displaying all the words in the linked list bool check(char c) //For checking if a spcific alphabet is present in all the words of the linked list void RemoveOther(char c) //For removing all the words which do not have a specific letter at specific positions string place(char c) //For placing an alphabet at it's position in the word
  • 5. National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science _____________________________________________________________________________________ Results: Below are a fewsamplesof the workingof the program Sample run: Result Lost
  • 6. National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science _____________________________________________________________________________________ Sample run: Result Win
  • 7. National University of Sciences and Technology (NUST) School of Electrical Engineering and Computer Science _____________________________________________________________________________________ If a letter, already used, is entered again, an error is generated saying “You have already used this word”. Although number of guesses remains the same. Discussionand Conclusion: Overall the game wasnot easyto program.There were a lotof problemsinitiallyandduringthe later phasesof the program. Once,we understoodthe logicandmade a comprehensive flow chartof our program inour mindsitbecame a biteasy.At laterstageswe have to come up withdifferentideasto solve ourproblemsfordifferentstepsof our programwithdeepthinking.We applieddifferentlogicsto performspecifictasksinthis waywe proceedtoour code by editing,changing andvarying.We alsotook helpfromvariouswebsitesforsyntax issuesandvariousotherissuesespeciallyregardingstringsto performdifferentfunctionsonwords,whichwere inthe formof strings.Atlastafterall the effortand hard workwe succeededinmakingagreat program, whichwe enjoyedalot.