You are on page 1of 19

COMPUTER SCIENCE

PROJECT ON “HANGMAN GAME”

ACADEMIC YEAR : 2022 - 2023

Project submitted in partial ful lment of Practical Examination for Class


XII, All India Senior Secondary Certi cate Examination

SUBMITTED TO : SUBMITTED BY :

MRS. CHANDRA PRIYA CN NAME : SAI PRANITH SENTHIL KUMAR


REG NO : 2474
CLASS : 11 AN2

SUGUNA PIP SCHOOL, COIMBATORE.


(CBSE, A liation No. 1930213)
1 of 19
ffi
fi
fi
CONTENTS

Teacher’s Signature

2 of 19
CERTIFICATE

This is to certify that Ms./Mr. Sai Pranith.S, Roll No. 2474 of class XI
(Session 2022-23), Suguna Pip School has completed the project based
on the topic “HANGMAN” as a part of the paper of Computer
Science (083).
It is a bona- de piece of work done under my supervision and
guidance to the best of my knowledge. It is the original work of the
candidate and is a result of her/his effort in partial ful lment of
requirement as per AISSCE curriculum of class XI.

TEACHER IN-CHARGE PRINCIPAL

EXTERNAL

DATE OF THE EXAMINATION _________________


3 of 19
fi
fi
ACKNOWLEDGEMENT

I would like to thank Mr. POOVANNAN, Principal, Coimbatore for his


immeasurable direction towards course of action and support
throughout the project.

I would also like to thank my Faculty Guide, Mrs.Chandrapriya , for her


valuable mentoring throughout the project. The interesting lectures of
my knowledgeable teacher has helped me understand the various
concepts related to “HANGMAN” and see their presence in the actual
world.

I got ample opportunity to do research, which enriched and broadened


my knowledge and understanding of this area. I am seriously indebted
to them.

Thanks to my parents, friends and everyone else who have been


directly or indirectly supportive during the course of my project.

STUDENT NAME : SAI PRANITH SENTHIL KUMAR

REGISTRATION NO : 2474

CLASS : 11 AN2

DATE OF SUBMISSION :
4 of 19
INTRODUCTION

Hangman is a guessing game for two or more players. One player thinks of
a word, phrase or sentence 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.
Though the origins of the game are unknown, a variant is mentioned in a
book of children's games assembled by Alice Gimme in 1894 called Birds,
Beasts, and Fishes.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
ll 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".
The word to guess is represented by a row of dashes representing each
letter of the word. Rules may permit or forbid proper nouns, such as
names, places, brands, or slang. If the guessing player suggests a letter
which occurs in the word, the other player writes it in all its correct
positions. If the suggested letter does not occur in the word, the other
player removes (or alternatively, adds) one element of a hanged stick gure
as a tally mark. The player guessing the word may, at any time, attempt to
guess the whole word.[3] If the word is correct, the game is over and the
guesser wins. Otherwise, the other player may choose to penalise the
guesser by adding an element to the diagram. On the other hand, if the
guesser makes enough incorrect guesses to allow the other player to
complete the diagram, the guesser loses. However, the guesser can also win
by guessing all the letters that appear in the word, thereby completing the
word, before the diagram is completed.

5 of 19
fi
fi
OBJECTIVE

In this assignment, we needed to create a Hangman game that


allowed people to guess a random word from a predetermined
array of words or play against each other. These game modes
were named Random and PvP. We also needed to create visuals
so that players could see the man being “drawn” if they
guessed wrong. In the game, players get 8 guesses and if they
make a wrong one, it is decreased by one. The picture included
shows the end result if someone wins. I used python to code
this project.

From this assignment, I learned to get comfortable with python


in general. A big thing this project taught me is coding style. I
made many mistakes when coding this so making sure that
there were comments for later reference was very helpful. I also
learned how important it was to give proper names to variables
and functions. I think I did a decent job because I can still read
and understand everything after more than a year of not
touching it.

6 of 19
SCOPE

Regarding to the data analysis, it was found that the use of


Hangman game technique gave the positive contributions
toward students’ ability to increase vocabulary mastery and
also generate the students’ motivation in learning process. The
majority were engaged in learning vocabulary. They were
excited and enthusiastic when acquiring vocabularies. It can be
seen when the researcher asked them to guess letter by letter in
their group, most of them focus and tried to nish the guessing
activity as soon as possible. Supported with a theory by Manan
(2016) that Hangman game is a useful technique for students
so that they can get a lot of vocabulary and the students can
also improve their courage to communicate with their friends,
especially in the lesson is proven. The researcher believes that
the Hangman game technique provides the students
opportunities to practice their vocabulary and bring the good
atmosphere into learning activity. In here, they practice on
several activities like spelling, pronouncing, guessing letter by
letter and also drawing the part of Hangman.

7 of 19
fi
HARDWARE AND SOFTWARE
REQUIREMENTS:

• An iPad / laptop / computer or any other tablet .

• Python 3.11.1

• Anaconda navigator

8 of 19
DESCRIPTION

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 suf cient numbers of vocabularies.
Harmer (2001, p.15) stated that having many vocabularies, learners
will be able to comprehend reading materials, catch other talking, give
responses, speak uently and write various topics. Students cannot
compose a sentence in writing and speaking without vocabulary.
Students will nd dif culty 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.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.

9 of 19
fi
fl
fi
fi
FUTURE SCOPE:

In this research, the use of Hangman game was highly effective to


increase students’ vocabulary achievement. It was indicated by the
students’ mean score of pre-test to post-test, it increased. The
effectiveness of the treatment also could be seen by the increasing of
number of vocabulary mastery after the treatment applied. Besides, the
effect size that obtained was categorised as strong effect. It was
consistent with the theory proposed by Novriana (2016) through
Hangman game student can enlarge their vocabulary. The ndings
also extend similar result of previous study done by Hedayat (2015),
the result of his research found that after implementing Hangman
game technique, the students’ vocabulary increase signi cantly.
Similarly, Evi (2017) conducted a study on the use of Hangman game
in teaching vocabulary to Year-8 students. The result revealed that
teaching vocabulary by Hangman game was effective and it is helpful
technique to the students.
The effectiveness of Hangman game technique on students’ vocabulary
was also shown by the students’ learning process. The students show
good participation and attention in learning process. It can be seen
when the researcher gave rst instruction to start the Hangman game.
Each group was quite focus to nish the game rst. It is supported by
Wiratania (2018), Hangman game supports students to be interested
in learning English and it also provides motivation for students.
Therefore in the future this would be an excellent game in improving
the vocabulary and pronunciation, thinking ability of children .

10 of 19
fi
fi
fi
fi
fi
DRAWBACKS

• It only tests spelling/ They don’t need to know how to


pronounce it.

• They can win without knowing the meaning.

• There isn’t much speaking involved in it.

• Hanging a man is a bit gory.

• It doesn’t tie in with any particular language points/ It’s


random.

• Some students shout out random letters without thinking


about it.

• The students start winning or losing every time.

11 of 19
SOURCE CODE :

import random
import time

# Initial Steps to invite in the game:


print("\nWelcome to Hangman game by IT SOURCE-CODE\n")
name = input("Enter your name: ")
print("Hello " + name + "! Best of Luck!")
time.sleep(2)
print("The game is about to start!\n Let's play Hangman!")
time.sleep(3)

# The parameters we require to execute the game:


def main():
global count
global display
global word
global already_guessed
global length
global play_game
words_to_guess =
["january","border","image"," lm","promise","kids","lungs","doll","rhyme"
“damage”,"plants"]
word = random.choice(words_to_guess)
length = len(word)
count = 0
display = '_' * length
already_guessed = []
play_game = ""

# A loop to re-execute the game when the rst round ends:

def play_loop():
global play_game
play_game = input("Do You want to play again? y = yes, n = no \n")
while play_game not in ["y", "n","Y","N"]:
play_game = input("Do You want to play again? y = yes, n = no \n")
if play_game == "y":
main()
elif play_game == "n":
12 of 19
fi
fi
print("Thanks For Playing! We expect you back again!")
exit()

# Initialising all the conditions required for the game:


def hangman():
global count
global display
global word
global already_guessed
global play_game
limit = 5
guess = input("This is the Hangman Word: " + display + " Enter your guess:
\n")
guess = guess.strip()
if len(guess.strip()) == 0 or len(guess.strip()) >= 2 or guess <= "9":
print("Invalid Input, Try a letter\n")
hangman()

elif guess in word:


already_guessed.extend([guess])
index = word. nd(guess)
word = word[:index] + "_" + word[index + 1:]
display = display[:index] + guess + display[index + 1:]
print(display + "\n")

elif guess in already_guessed:


print("Try another letter.\n")

else:
count += 1

if count == 1:
time.sleep(1)
print(" _____ \n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")

elif count == 2:
13 of 19
fi
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | \n"
" | \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")

elif count == 3:
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | | \n"
" | \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " guesses remaining\n")

elif count == 4:
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | | \n"
" | O \n"
" | \n"
" | \n"
"__|__\n")
print("Wrong guess. " + str(limit - count) + " last guess remaining\n")

elif count == 5:
time.sleep(1)
print(" _____ \n"
" | | \n"
" | |\n"
" | | \n"
" | O \n"
" | /|\ \n"
" | / \ \n"
"__|__\n")
14 of 19
print("Wrong guess. You are hanged!!!\n")
print("The word was:",already_guessed,word)
play_loop()

if word == '_' * length:


print("Congrats! You have guessed the word correctly!")
play_loop()

elif count != limit:


hangman()

main()

hangman()

15 of 19
OUTPUT:

16 of 19
17 of 19
CONCLUSION :

From the entire data on the previous explanation, the


researcher can conclude that the implementation of Hangman
game contribute a signi cant enhancement to strengthen
young learners’ vocabulary .From the conclusion of this
research, the researcher gives recommendations dealing with
the result accomplished. (1) English teachers are suggested to
use Hangman game as a technique in teaching vocabulary. It
recommended because Hangman game provide motivation for
teaching and learning vocabulary. In implementing Hangman
game, the classroom would be noisy. English teacher should be
well-prepare in order to covers this problem. Beside that, the
teacher should explain the order clearly to avoid students’
confusion in playing Hangman game. (2) For the students, It
suggested that the students should be more responsible in
group. The students also suggested to pay attention to the
teacher’s explanation, especially when the teacher explains the
steps of playing Hangman game. (3) For other researchers who
have any intention to explore and complete this technique to
different kinds of material suitable with its characteristic and
school curriculum.Hangman game also possible to be used in
other genre of text, for example report text, recount text, and
narrative text.

18 of 19
fi
BIBLIOGRAPHY

• Sumita Arora

• www.wikipedia.com

• www.python.com

• jurnal.untan.ac.id

• pcgamebenchmark.com

• www.programiz.com

19 of 19

You might also like