-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhangman.py
More file actions
43 lines (33 loc) · 1.43 KB
/
hangman.py
File metadata and controls
43 lines (33 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import random
#Create Welcome message Ask player A to enter a word
hangman_display = ["",
" _______________ " ,
" | | " ,
" | | " ,
" | O " ,
" | \ | / " ,
" | \|/ " ,
" | | " ,
" | | " ,
" | / \ " ,
" | / \ " ,
" | " ,
" | " ,
" | " ,
"_______|_________________________ "
]
print("\n".join(hangman_display[0 : len(hangman_display)]))
print("\n")
print("Welcome to Hangman Game!!!")
secret_word_clue = {
"Taylor Swift", "Famous Female Pop Singer",
"Java", "Number one programming language",
"Albert Einstein", "A famous American Scientist",
"Barack Obama", "A well known American President",
"The White House", "A famous building in Washington DC"
}
rand = random.randint(0, len(secret_word_clue) + 1)
#If player B guesses correct letter, fill in the letter at that position
#If player A guesses wrong letter, start building hangman
#If the hangman is complete, player A wins
#Player B wins, if word guessed correctly before the hangman formed