Professional Documents
Culture Documents
Hangman Game
Hangman Game
INTRODUCTION
Python is one of those rare languages which can claim to be both simple and
powerful. You will find yourself pleasantly surprised to see how easy it is to
concentrate on the solution to the problem rather than the syntax and structure of
the language you are programming in. When you write programs in Python, you
never need to bother about the low-level details such as managing the memory used
by your program,etc. Python is an example of a FLOSS (Free/Libre and Open
Source Software). In simple terms, you can freely distribute copies of this software,
read its source code, make changes to it, and use pieces of it in new free programs.
Some times we make mistake to Spell a Word to overcome that mistake. I have made
a game named as Hangman based on python programming. Basically in this we have
to guess the words and fill in the given blanks.
1
1.4 OBJECTIVES
The main objectives of this project is selects a secret word from a list of secret words. The
random module will provide this ability, so line 1 in program imports it.
Random
Counter
2
CHAPTER 2
2.1 AIM
The main aim of the project is to provide features like creating contacts, deleting
contacts, searching contacts and to modify the contacts, it also uses the database to
store the contacts details like address etc,. safely in the database. .
2.2 SCOPE
The hardware requirements may serve as the basis for a contract for the
implementation of the system and should therefore be a complete and consistent
specification of the whole system. They are used by software engineers as the starting
point for the system design. It shows what the systems do and not how it should be
implemented.
3
• Processor : Pentium iv and above (or) equivalent
The software requirements are the specification of the system. It should include
both a definition and a specification of requirements. It is a set of what the system should
do rather than how it should do it. The software requirements provide
a basis for creating the software requirements specification. It is useful in estimating cost,
planning team activities, performing tasks and tracking the team’s and tracking the team’s
progress throughout the development activity.
4
CHAPTER 3
SYSTEM IMPLEMENTATION
3.2 IMPLEMENTATION
The origins of Hangman are obscure meaning not discovered, but it seems to
have arisen in Victorian times, ” says Tony Augarde, author of The Oxford Guide
to Word Games. The game is mentioned in Alice Bertha Gomme’s “Traditional
Games” in 1894 under the name “Birds, Beasts and Fishes.” The rules are
simple; a player writes down the first and last letters of a word and another player
guesses
5
the letters in between. In other sources, [where?] the game is called “Gallows”,
“The Game of Hangin”, or “Hanger”.
• Technical
• Economic
• Legal
• Operational
• Schedule
Under technical, engineers ask whether the correct technology exists to support
a project. Under economic, they look at costs and benefits. Under legal, they look
at any barriers to legal implementation, for instance, privacy issues or safety
6
CHAPTER 4
CONCLUSION
4.1 CONCLUSION
Hence the project, it contains all the required functions which include
adding, viewing, deleting and updating contact lists. While adding the contact of a
person, he/she has to provide first name, last name, gender, address and contact
details. The user can also update the contact list if he/she wants to. For this, the
user has to double-click on a record that he/she wishes to edit. The system
shows the contact details in a list view. And also the user easily delete any
contact details.This GUI based Contact Management system provides the
simplest management of contact details. In short, this projects mainly focus on
CRUD.
There’s an external database connection file used in this mini project to save
user’s data permanently.
7
REFERENCES
8
APPENDIX
LIST OF FIGURES
9
Fig 5.3: Output Screen
10
Fig 5.5:Ten letters Words
11
SOURCE CODE:
# Python Program to illustrate
# Hangman Game
import random
from collections import Counter
someWords = '''apple banana mango strawberry
orange grape pineapple apricot lemon coconut
watermelon
cherry papaya berry peach lychee muskmelon'''
someWords = someWords.split(' ')
# randomly choose a secret word from our
"someWords" LIST.
word = random.choice(someWords)
if __name__ == '__main__':
print('Guess the word! HINT: word is a name of a
fruit')
for i in word:
# For printing the empty spaces for letters
of the word
print('_', end = ' ')
print()
playing = True
# list for storing the letters guessed by the player
letterGuessed = ''
chances = len(word) + 2
correct = 0
flag = 0
try:
while (chances != 0) and flag == 0: #flag is
updated when the word is correctly guessed
print()
chances -= 1
try:
guess = str(input('Enter a
letter to guess: '))
except:
print('Enter only a letter!')
continue
12
#continue
except KeyboardInterrupt:
print()
print('Bye! Try again.')
exit()
13
14