Cs Project Guesstheword
Cs Project Guesstheword
Grade : 11A
Reg. No : 11A42
Date: Teacher-in-Charge
Apart from the effort of mine, the success of this project depends largely on the
encouragement and guidance of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in successful completion of this
project.
I express deep sense of gratitude to almighty God for giving me strength for the
successful completion of this project.
I express deep sense of gratitude to the luminary The Principal Mrs. Maya, who
has been continuously motivating and extending their helping hand to us.
My sincere thanks to Mr. Sanjay R, the teacher in-charge, a guide, a mentor, and
above all, a friend who critically reviewed my project and helped in solving each
and every problem occurred during the implementation of the project.
The guidance and support received from all the members who contributed and who
are contributing to this project was vital for the success of this project. I am grateful
for their constant support and help.
TABLE OF CONTENTS
PAGE
SNO DESCRIPTION
NO
1
01 INTRODUCTION TO PYTHON
2
02 INTRODUCTION TO THE PROJECT
3
03 SOURCE CODE
08
04 OUTPUT
11
05 HARDWARE AND SOFTWARE REQUIREMENTS
12
06 BIBLIOGRAPHY
INTRODUCTION TO PYTHON
Python is a widely used general-purpose, high level programming language. It was initially
designed by Guido van Rossum in 1991 and developed by Python Software Foundation. It was
mainly developed for emphasis on code readability, and its syntax allows programmers to express
concepts in fewer lines of code. Python is a programming language that lets you work quickly and
integrate systems more efficiently.
It is used for,
• Software Development
• System Scripting
Features of Python:
➢ It is easily compatible with other language like C, C++, Core Java , etc.,
Guess the Word is an engaging word-guessing game where players try to uncover a hidden
word by guessing one letter at a time. The word is initially displayed as underscores, with each
correct letter revealed in its corresponding position. Players have 7 attempts to guess the correct
letters. If an incorrect letter is guessed, an attempt is lost. The goal is to guess the entire word
before running out of attempts.
With a selection of randomly chosen words from a variety of categories, this game is both fun and
challenging. The game ends when the player either guesses the word correctly or exhausts all
attempts.
Features:
• Randomly selected words from a predefined list
• 7 attempts to guess the word
• Keeps track of guessed letters and attempts
• Simple and interactive gameplay
Source code:
import random
noofwords = len(words)
wordindex = random.randint(0,noofwords)
word = words[wordindex]
word_state = []
# Fill the list with underscores for each letter in the word
word_state.append("_")
# Game introduction
# Game loop
# Validate input
continue
if guess in guessed_letters:
continue
guessed_letters.append(guess)
if guess in word:
for i in range(len(word)):
if word[i] == guess:
word_state[i] = guess
else:
attempts = attempts - 1
# End of game
Output:
When the word is guessed correctly
Output when the word is not guessed within seven attempts:
HARDWARE AND SOFTWARE REQUIREMENTS
HARDWARE REQUIREMENTS:
RAM : 512MB+
SOFTWARE REQUIREMENTS:
◦ Windows OS