Professional Documents
Culture Documents
Project
Project
Submitted to
Prepared by
Tanish Darji(226540307023)
V.P.M.P. POLYTECHNIC
DEPARTMENT OF COMPUTER
ENGINEERING
CERTIFICATE
This is to certify that Mr. Jimesh.P.Raval. of
22CE1 class, Enrollment No. 226540307171 has
satisfactory completed his / her term work in SLP
(4330701) for the term ending in NOVEMBER 2023
Date:
CERTIFICATE
This is to certify that Mr. Keshar.J.Prajapati of
22CE1 class, Enrollment No. 226540307159 has
satisfactory completed his / her term work in SLP
(4330701) for the term ending in NOVEMBER 2023
Date:
CERTIFICATE
This is to certify that Mr.Tanish Darji of 22CE1
class, Enrollment No. 226540307023 has satisfactory
completed his / her term work in SLP (4330701) for
the term ending in NOVEMBER 2023
Date:
Warm regards,
Jimesh Raval(226540307171)
Tanish Darji(226540307023)
TABLE OF CONTENT
1 Introduction
4 Example of Gameplay
5
Education value
6 PROJECT CODE
7 Conclusion
1. Introduction
Hangman is a classic word game that combines wit and
strategy. Its simplicity makes it accessible to all, while its
unpredictability keeps players on the edge of their seats.
Whether you're a wordsmith or just looking for a good
time, Hangman offers a delightful blend of suspense and
linguistic prowess.
->Word: _ _ _ _ _ _
Attempts Left: 6
Player's Turn 1:
Correct! Word: P _ _ _ _ _
Attempts Left: 6
Player's Turn 2:
Incorrect! Word: P _ _ _ _ _
Player's Turn 3:
Correct! Word: PT _ _ _ _
Attempts Left: 5
Player's Turn 4:
Player's Turn 5:
Attempts Left: 4
1. Vocabulary Enrichment:
def choose_word():
words = ['apple', 'banana', 'orange', 'grape', 'strawberry', 'wate
rmelon', 'pineapple']
return random.choice(words)
def hangman():
word_to_guess = choose_word()
guessed_letters = []
attempts = 6
print("Welcome to Hangman!")
print(display_word(word_to_guess, guessed_letters))
if '_' in display:
print(f"Sorry, you ran out of attempts. The word was
'{word_to_guess}'.")
hangman()
output like:
pineapple
Congratulations! You guessed the word!
7.Conclusion
Key Points:
Objective: The goal is to guess a hidden word by
suggesting letters, emphasizing the challenge of solving it
before running out of attempts.
Rules: Players guess one letter at a time, incorrect guesses
lead to the drawing of a "hangman" figure, and there are
limited attempts before the game ends.
Example Gameplay: We walked through a simple
example, showcasing the dynamic interaction between
the player and the program as they strive to uncover
the hidden word.
Educational Value: Hangman offers benefits such as
vocabulary enrichment, the development of problem-
solving skills, and an introduction to basic programming
concepts for coding enthusiasts
Refrences