0% found this document useful (0 votes)
10 views26 pages

Hangman2 0

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views26 pages

Hangman2 0

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Demonstration school

rie, mysore

hanGman
name: shreyas srinath
class: 11 a
th

roll number: 19
subject: computer science

1
certificate

This is to certify that s. Shreyas of class 11A,


demonstration school, has successfully completed
the investigatory project in computer science on the
topic “hangman” towards partial fulfilment of
computer science practical examination conducted
by CBSE for academic year 2023-24, under the
guidance of Mrs Preethi , Pgt computer, Dms,
Mysore.

siGnature siGnature
(teacher) (principal)

2
acknowleDGement
I want to convey my heartfelt gratitude to my teacher, Mrs.
Preethi mam, for their support and encouragement during the
research of this computer science project. Their expertise in
the subject matter greatly contributed to the depth and quality
of the project.

Also, I would like to express my sincere gratitude to our


principal for his unwavering support and encouragement
throughout this project. I am grateful for the opportunity to
have worked on this project under his guidance, and I am
confident that my learning and personal growth have been
enriched as a result.

I would also like to thank my friends, for their feedback and


support. Their input was invaluable in helping me to develop
and refine my ideas. Lastly, my family’s support and
encouragement were essential throughout the completion of
this project.

shreyas. s

11 ath

3
inDeX
sl
content
no
1 introDuction to the Game

2 objective of the project

3 proposeD system

4 system Development life cycle


phases of system Development
5
life cycle
6 flowchart

7 source coDe
8 output
9 requirements
10 conclusion
11 biblioGraphy
4
introDuction to the Game

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 or numbers 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 Gomme 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 fill in the blanks. The
word to guess is represented by a row of dashes representing
each letter or number 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
adds (or alternatively, removes) one element of a hanged stick
figure as a tally mark. Generally, the game ends once the word
is guessed, or if the stick figure is complete signifying that all
guesses have been used.
The player guessing the word may, at any time, attempt to
guess the whole word. If the word is correct, the game is over
and the guesser wins. Otherwise, the other player may choose
to penalize the guesser by adding an element to the diagram. 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
In python:
This is a simple Hangman game using Python programming
language. Beginners 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.The Game: Here, a
random word is picked up from our collection and the player
gets limited chances to win the game.When a letter in that
word is guessed correctly, that letter position in the word is
made visible. In this way, all letters of the word are to be
guessed before all the chances are over.

First, we will ask for the name of the user. We will take the user
input using the input () method. After execution, the input ()
method takes the input from the user and returns a string. Next,
we will select a word and ask the user to start guessing the
characters in the word.

We will also define the maximum number of attempts the user


can take.

Now, we will use a while loop to repeatedly ask the user to


guess the character until the attempts are exhausted.

Inside the while loop, if the user guesses the correct character.
We will include it in the response. Otherwise, we will notify the
user that they made a mistake.

If the user is able to guess all the characters of the word within
the maximum number of attempts, they win the game.

If the user exhausts all their attempts before guessing the entire
word, they lose.

6
objectives of the project
1. To develop an understanding of how computing
technology presents new ways to address problems, and
use computational thinking to analyse problems and to
develop and evaluate solutions.
2. To develop an understanding of the working of computers,
the 1st component parts of computer systems and how
they interrelate, software , data, communications and
users of computing technology.
3. Appreciate the ethical and social implications relating to
the use of technology and information and identify the
impact of technology on human life.
4. To develop a program that helps in calculating the BMI in
an easier way compared to other ways.
5. To create a program that has no errors or malfunctions
during the time of execution.

7
proposeD system
The origins of Hangman are obscure meaning not discovered,
but it seems to have arisen in Victorian times, ” says Tony
Augadre, 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 the letters in
between. In other sources, [where?] the game is called
“Gallows”, “The Game of Hanging”, or “Hanger”.

This is a simple Hangman game using Python programming


language. Beginners can use this as a small project to boost
their programming skills and understanding logic.

1. 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.

2. The Game: Here, a random word (a fruit name) is picked


up from our collection and the player gets limited chances
to win the game.

3. When a letter in that word is guessed correctly, that letter


position in the word is made visible. In this way, all letters
of the word are to be guessed before all the chances are
over.

8
system Development life
cycle

The System Development Life Cycle (SDLC) provides a well-


structured framework that gives an idea, of how to build a
system. It consists of steps as follows – Plan, Analyze, Design,
Develop, Implement and Maintain. In this article, we will see all
the stages of system development.

Important Topics for the System Development Life Cycle

• Stages (Phases) of System Development Life Cycle


o Stage 1: Plan
o Stage 2: Analyse
o Stage 3: Design
o Stage 4: Develop
o Stage 5: Implement
o Stage 6: Maintain
• How is System Development Life Cycle different from
System Design Life Cycle?
• Significance of System Design in System Development
Life Cycle

We will delve into the significance of each stage, emphasizing


the critical role played by System Design in the overall process.

9
Stages (Phases) of System Development Life Cycle

The System Development Life Cycle encompasses a series of


interconnected stages that ensure a systematic approach to
system development. The stages include Planning, Analysis,
Design, Development, Implementation, and Maintenance. Each
stage contributes to the successful completion of the system,
with System Design serving as a crucial component.

Stage 1: Plan

The Planning stage lays the groundwork for the entire SDLC. It
involves identifying the system’s goals, defining project scope,
setting objectives, establishing timelines, and determining
available resources. Planning ensures that the development
process aligns with organizational needs and sets a clear
direction for subsequent stages.

Stage 2: Analyse

During the Analysis stage, the focus is on gathering and


understanding the requirements of the system. This includes
conducting interviews, studying existing processes, and
identifying stakeholders’ needs. The gathered information
serves as a basis for designing a system that meets users’
expectations and addresses organizational challenges.
10
Stage 3: Design

System Design is a critical stage in the SDLC, where the


requirements gathered during the Analysis phase are translated
into a detailed technical plan. It involves designing the system’s
architecture, database structure, and user interface, and
defining system components. The Design stage lays the
foundation for the subsequent development and
implementation phases.

Stage 4: Develop

The Development stage involves the actual coding and


programming of the system. Based on the design
specifications, developers write code, create database
structures, and implement necessary functionalities. Rigorous
testing and quality assurance are performed to ensure the
system’s accuracy, performance, and adherence to the design
requirements.

Stage 5: Implement

This stage involves deploying the developed system into the


production environment. This includes activities such as system
installation, data migration, training end-users, and configuring
necessary infrastructure. Implementation requires careful
planning and coordination to minimize disruptions and ensure a
smooth transition from the old system to the new one.

Stage 6: Maintain

Maintenance is an ongoing stage that involves monitoring,


managing, and enhancing the system’s performance and
functionality. It includes activities such as bug fixes, updates,
security patches, and addressing user feedback. Regular
maintenance ensures the system remains reliable, secure, and
adaptable to changing business needs.

11
How is System Development Life Cycle different from System
Design Life Cycle?

Let’s explore the key differences between the System


Development Life Cycle and the System Design Life Cycle in a
more narrative form:

• Scope:

o System Development Life Cycle: Encompasses the


entire process of developing and managing an
information system, from initial planning to system
retirement and maintenance.

o System Design Life Cycle: Focuses specifically on


the design aspect within the broader System
Development Life Cycle. It deals with the detailed
planning and creation of system architecture,
components, and modules.

• Phases:

o System Development Life Cycle: Comprises


various phases, including planning, analysis, design,
implementation, and maintenance. Each phase
contributes to the overall development and
management of the system.

o System Design Life Cycle: Emphasizes phases


such as preliminary design, detailed design,
implementation, testing, and maintenance. The
primary focus is on the detailed planning and creation
of design specifications.

• Emphasis:

o System Development Life Cycle: Provides a


comprehensive framework for the entire system
development process. It addresses aspects beyond

12
design, including user requirements, system
functionality, coding, and ongoing maintenance.

o System Design Life Cycle: Concentrates on the


design aspect, specifically creating detailed
specifications for system components, architecture,
and user interfaces. It places a strong emphasis on
the planning and structuring of the system.

• Objective:

o System Development Life Cycle: Aims to guide the


development process from the conceptualization of
the system to its implementation, testing,
deployment, and ongoing maintenance.

o System Design Life Cycle: Aims to create detailed


design specifications and plans that serve as a
blueprint for the development team. It focuses on
translating high-level requirements into actionable
design elements.

• Involvement:

o System Development Life Cycle: Involves a wide


range of stakeholders, including users, business
analysts, developers, testers, and maintenance
personnel, across various phases of the life cycle.

o System Design Life Cycle: Primarily involves


designers, architects, and developers in the creation
of detailed design specifications and plans.
Collaboration with other stakeholders occurs, but the
emphasis is on the design team.

• Iterations and Feedback:

o System Development Life Cycle: Embraces an


iterative approach with feedback loops to
accommodate changes and improvements
13
throughout the life cycle. Users and stakeholders are
involved in providing continuous feedback.

o System Design Life Cycle: Is also iterative, with the


design evolving based on feedback from testing,
integration, and the need for design adjustments.

• Output:

o System Development Life Cycle: Outputs a fully


developed, tested, and maintained information
system that meets user requirements and business
objectives.

o System Design Life Cycle: Outputs detailed design


specifications, architectural plans, and guidelines that
serve as a basis for the development team to
implement and test the system.

• Timeframe:

o System Development Life Cycle: Spans the entire


life cycle of the system, and the timeframe can vary
from months to years, depending on the complexity
of the project.

o System Design Life Cycle: Focuses on the design


within shorter timeframes, as part of the broader
system development process.

In essence, while System Development Life Cycle provides a


holistic view of the system development process, System
Design Life Cycle narrows its focus to the detailed planning and
creation of the system’s design components. Both are integral
to successful system development, with the latter playing a
crucial role in translating high-level requirements into actionable
design elements.

Significance of System Design in System Development Life


Cycle
14
System Design is a crucial stage in the SDLC as it bridges the
gap between requirements analysis and system development.
It transforms user needs and functional specifications into a
detailed technical plan that guides the development team.
Proper system design ensures that the developed system
aligns with the desired functionality, performance, and
scalability requirements.

15
source coDe
import random

name=input ("enter your name :")

print ("good luck !!!", name)

words=['rainbow','computer','science','programming','python','m
athematics','player','condition','reverse','water','board','geeks','bl
ackberry','empathy','organization','wolves','bacteria','abandon']

print (" the word you should guess will be in this group", words)

word= random.choice(words)

print ('guess the characters')

guesses=' '

turns=20

print ("you have “, turns, “guesses")

while turns>0:

failed=0

for char in word:

if char in guesses:

print (char, end=" ")

else:

print ("_")

failed+=1

if failed==0:

16
print ("The word is:", word)

print ("You win ")

break

guess=input ("enter guess")

guesses+=guess

if guess not in word:

turns-=1

print("wrong")

print("you have ", +turns ," more guesses")

if turns==0:

print("you loose ")

print("the word is ",word)

17
output

enter your name Shreyas

good luck !!! Shreyas

guess the characters

enter guess: r

r_

18
enter guess: i

r_

I_

enter guess: b

r_

I_

b_

enter guess: w

r_

I_

b_

enter guess: a

rai_

19
b_

enter guess: o

rai_

bow

enter guess: n

rainbow You win

The word is: rainbow

20
screenshot of proGram with output

21
22
flow chart

23
requirements
Hardware requirements:
Processor: AMD ryzen 5 5000 series 5500u
Rom:
Ram:
Laptop: Lenovo ideapad slim 1

Software requirements:
Windows 11
Python thonny interpreter

24
conclusion
To conclude I would like to say that python can be used
everywhere and it should be used with proper knowledge. also
this project has increased my knowledge on how python
works.

25
biblioGraphy
1. computer science with python- class 11 NCERT
textbook.
2. Website: https://www.geeksforgeeks.org/.

26

You might also like