Project
Project
AN INTERNSHIP REPORT
Bachelor of Engineering
In
Ms.Nandhini S
Sr Project Manager
November 2022
1
MATRUSRI ENGINEERING COLLEGE
SAIDABAD – 500059
This is a Record of bonafide work carried out by me under the guidance of Ms.
Nandini. The results embodied in this report have not been reproduced/copied from
any source. The results embodied in this report have not been submitted to any other
university or institute for the award of any other degree or diploma.
Dept. of CSE,
MECS
II
ABSTRACT
This is a simple Hangman game using Python programming language. We can use this
as a small project to boost their programming skills and understanding logic. The
Hangman program randomly selects a secret word from a list of secret words. The
random module will provide this ability, so line 1 in program imports it. Hangman is a
popular word game in which one player (the "chooser") chooses a secret word and
another player (the "guesser") attempts to guess the word one letter at a time. If a
guessed letter appears in the word, all instances of it are revealed. If not, the guesser
loses a chance. If the guesser figures out the secret word before he or she runs out of
chances, he or she wins. If not, the player who chose the word wins.
III
TABLE OF CONTENTS
1 Introduction
2 Literature Survey
4 Flowchart
5 Sample code
6 Output screens
7 Conclusion
8 Future Enhancements
9 References
IV
1.INTRODUCTION:
Hangman is a guessing game for two or more players. One player thinks of a word, phrase or
sentense and the other(s) tries to guess it by suggesting letters within a certain number of guesses.
Originally a paper-and-pencil game, there are now electronic versions. Hangman is a guessing game
which is represented with a set number of dashes. The dashes consisted of unknown words and the
clues. It involves the progressive drawing, a line for each incorrect answer. Hangman game played
by two or more people that consist a host and players. The players guess letter by letter, while the
host draw the part of hangman.
This game focus on spelling, pronunciation and vocabulary. Wiratania (2018), Hangman game can
be used to enlarge vocabulary mastery, practice spelling, and trained students’ concentration. This
game helps teacher in controlling classroom. While the students are playing Hangman game in the
classroom, the teacher observes the process of acquiring vocabulary .Vocabulary is the fundamental
element for language learners. It is the basic resource for any language classes. Vocabulary has the
greater role that supports all language skills. The learners will speak, listen, read and write well if
they have sufficient numbers of vocabularies. By knowing many vocabularies, learners will be able
to comprehend reading materials, catch other talking, give responses, speak fluently and write
various topics. Students cannot compose a sentence in writing and speaking without vocabulary.
Students will find difficulty to understand what they read and listen with poor vocabulary. As a
consequence, students should master an adequate number of vocabulary and they must learn the
forms and the meanings of words. Therefor, developing students’ vocabulary should be taken into
consideration.
1.1Existing System:
Hangman game was Originally a Paper-and-pencil game.
One player thinks of a word, phrase or sentence and the other tries to guess it by suggesting
letters within a certain number of guesses.
Disadvantages:
It Cannot Be Played Alone
It Tends to Limit Academic Progress
Does not Foster Technological Growth
1
It might be boring to go with this version.
1.2 Proposed System:
Thus, I proposed an GUI version.
The main advantage of this version of this game is to widen the thinking capacity of the
player as the player comes across a lot of words he/she might not know.
In my version of game I have include Graphical User Interface that might boost the player.
Advantages:
They can be used as an educational tool for children or adults, and they’re great for helping
people build their vocabulary skills.
This game can help you improve your memory skills and think more creatively.
2
2.LITERATURE SURVEY:
Though the origins of the game are unknown, a variant is mentioned in a book of children's games
assembled by Alice Gomme in 1894 called Birds, Beasts, and Fishes.[1] This version lacks the image
of a hanged man, instead relying on keeping score as to the number of attempts it took each player to
fill in the blanks.
A version which incorporated hanging imagery was described in a 1902 Philadelphia Inquirer article,
which stated that it was popular at "White Cap" parties hosted by "Vigilance Committees" where
guests would wear "white peaked caps with masks".Vocabulary is one of the basic components of
language and there is no languages exist without words (Napa, 1990: 5). In order to communicate
well in English, children should get an adequate number of words and know how to use them
accurately. Vocabulary becomes an important aspect in learning English as a target language,
because it is the first basic important aspect in learning English. Besides that, it is impossible to be
successful in study a language without mastering the vocabulary. In this case, Kridalaksana (1993:
127) states that vocabulary is one of language components that maintain all of information about
meaning and using word in a language. In short, vocabulary is one of the important language aspects
which should be learned by language learners in order to be able to communicate. Besides that, the
more vocabulary which the learners have, it will be easier for them to develop and learn English as
the foreign language.
3
3.METHODOLOGY:
4
4.FLOWCHART
5
5.SAMPLE CODE
main.py
import pygame
from math import sqrt
import sys
from player import Player
from menu import draw_menu, pause, BACKGROUND_COLOR
from leaderboard import get_leaderboard
from board import Board
from game import Game
# Display variables
WIDTH, HEIGHT = 1200, 700
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption('HANGMAN GAME')
pygame.init()
6
board.draw(surface, player, game, board)
pygame.time.delay(200)
letter[3] = False
game.guessed.append(ltr)
if ltr not in game.word:
player.lives -= 1
if player.lives == 0:
board.draw(surface, player, game, board)
pygame.time.delay(1000)
board.draw_name(surface, player, board, main,
game.word, 'Lost')
break
elif event.type == pygame.MOUSEBUTTONDOWN:
mouse_x, mouse_y = pygame.mouse.get_pos()
for letter in game.letters:
x, y, ltr, visible, clicked = letter
if visible:
dist = sqrt((x - mouse_x) ** 2 + (y - mouse_y) ** 2)
if dist < game.radius:
letter[4] = True
board.draw(surface, player, game, board)
pygame.time.delay(500)
letter[3] = False
game.guessed.append(ltr)
if ltr not in game.word:
player.lives -= 1
if player.lives == 0:
won = True
for letter in game.word:
if letter not in game.guessed:
won = False
break
if won:
player.score += 10 * len(game.word)
board.draw(surface, player, game, board)
pygame.time.delay(500)
board.draw_name(surface, player, board, main, game.word, 'Won')
break
pygame.quit()
7
sys.exit()
def main_menu(surface):
active = 1
player = Player()
run = True
difficulties = ['LOW', 'MEDIUM', 'HARD']
while run:
surface.fill(BACKGROUND_COLOR)
buttons = ['NEW GAME', f'LEVEL OF DIFFICULTY: {difficulties[player.difficulty -
1]}', 'LEADERBOARD', 'EXIT']
draw_menu(surface, 'MAIN MENU', buttons, WIDTH, HEIGHT, active)
pygame.display.update()
pygame.quit()
sys.exit()
if __name__ == '__main__':
8
main_menu(WIN)
# Set Life as 7 (available Life is 6)
self.lives = 7
Hangman_words.py
word_list = [
'abruptly',
'absurd',
'abyss',
'affix',
'askew',
'avenue',
'awkward',
'axiom',
'azure',
'bagpipes',
'bandwagon',
'banjo',
'bayou',
'beekeeper',
'bikini',
'blitz',
'blizzard',
'boggle',
'bookworm',
'boxcar',
'boxful',
'buckaroo',
'buffalo',
'buffoon',
'buxom',
9
'buzzard',
'buzzing',
'buzzwords',
'caliph',
'cobweb',
'cockiness',
'croquet',
'crypt',
'curacao',
'cycle',
'daiquiri',
'dirndl',
'disavow',
'dizzying',
'duplex',
'dwarves',
'embezzle',
'equip',
'espionage',
'euouae',
'exodus',
'faking',
'fishhook',
'fixable',
'fjord',
'flapjack',
'flopping',
'fluffiness',
'flyby',
'foxglove',
'frazzled',
'frizzled',
'fuchsia',
'funny',
10
'gabby',
'galaxy',
'galvanize',
'gazebo',
'giaour',
'gizmo',
'glowworm',
'glyph',
'gnarly',
'gnostic',
'gossip',
'grogginess',
'haiku',
'haphazard',
'hyphen',
'iatrogenic',
'icebox',
'injury',
'ivory',
'ivy',
'jackpot',
'jaundice',
'jawbreaker',
'jaywalk',
'jazziest',
'jazzy',
'jelly',
'jigsaw',
'jinx',
'jiujitsu',
'jockey',
'jogging',
'joking',
'jovial',
11
'joyful',
'juicy',
'jukebox',
'jumbo',
'kayak',
'kazoo',
'keyhole',
'khaki',
'kilobyte',
'kiosk',
'kitsch',
'kiwifruit',
'klutz',
'knapsack',
'larynx',
'lengths',
'lucky',
'luxury',
'lymph',
'marquis',
'matrix',
'megahertz',
'microwave',
'mnemonic',
'mystify',
'naphtha',
'nightclub',
'nowadays',
'numbskull',
'nymph',
'onyx',
'ovary',
'oxidize',
'oxygen',
12
'pajama',
'peekaboo',
'phlegm',
'pixel',
'pizazz',
'pneumonia',
'polka',
'pshaw',
'psyche',
'puppy',
'puzzling',
'quartz',
'queue',
'quips',
'quixotic',
'quiz',
'quizzes',
'quorum',
'razzmatazz',
'rhubarb',
'rhythm',
'rickshaw',
'schnapps',
'scratch',
'shiv',
'snazzy',
'sphinx',
'spritz',
'squawk',
'staff',
'strength',
'strengths',
'stretch',
'stronghold',
13
'stymied',
'subway',
'swivel',
'syndrome',
'thriftless',
'thumbscrew',
'topaz',
'transcript',
'transgress',
'transplant',
'triphthong',
'twelfth',
'twelfths',
'unknown',
'unworthy',
'unzip',
'uptown',
'vaporize',
'vixen',
'vodka',
'voodoo',
'vortex',
'voyeurism',
'walkway',
'waltz',
'wave',
'wavy',
'waxy',
'wellspring',
'wheezy',
'whiskey',
'whizzing',
'whomever',
'wimpy',
14
'witchcraft',
'wizard',
'woozy',
'wristwatch',
'wyvern',
'xylophone',
'yachtsman',
'yippee',
'yoked',
'youthful',
'yummy',
'zephyr',
'zigzag',
'zigzagging',
'zilch',
'zipper',
'zodiac',
'zombie',
]
15
6.OUTPUT SCREENS:
16
17
18
19
20
8.FUTURE ENHANCEMENTS:
In future I want to extend this model by adding the meaning of the words that can be displayed along
with the word.Instead of the user searching the wrongly guessed word after the game, I would like to
add a module that can display the meaning also. I would also like to add the sound effect to the
game, so that it makes it more entertaining to the player and .This timer concept can also be
implemented in another way ,where the timer will be running and there will be a scoreboard that will
be displaying the position of the players as per the time taken.
21
7.CONCLUSION:
22
8.REFERENCES:
23