I made a non functioning Hangman. It makes a loop because it isn’t finished. Will be finished (hopefully) on Monday.
Filebin of the .py file (lasts 1 week):
https://filebin.net/nsyk2ttk3zx9fjyp
Source Code
import random
Game = True
while Game == True:
word = [“Array”, “Steam”, “Random”, “Import”, “Empires”, “Of”, “The”, “Undergrowth”, “Spore”, “Myrmecologist”, “Deoxyribonucleic”, “Plague”, “Pulsar”, “Ant”, “Thrive”, “Evolution”, “Ecosystem”, “Genetic”, “Microbe”, “Multicellular”, “Slug”, “Disco”, “Beetle”, “Uprising”, “Paradox”, “Star”, “Emperor”, “Espionage”, “Nemesis”, “Behaviour”, “Interactive”, “Dead”, “By”, “Daylight”, “Trapper”, “Wreith”, “Hag”, “Huntress”, “Myers”, “Shape”, “Nurse”, “Blight”, “Twins”, “Legion”, “Ghost”, “Face”, “Nightmare”, “Spirit”, “Executioner”, “Executioner”, “Pyramid”, “Head”, “Silent”, “Hill”, “Fallout”, “Elder”, “Scrolls”, “Ancestors”, “Humankind”, “Odyssey”, “Human”, “Revolutionary”, “Games”, “Studios”, “Aware”, “Awakening”, “Space”, “Ascended”, “Stage”, “Electronic”, “Arts”, “Hangman”, “Syntax”, “Error”, “Dungeon”, “Community”, “Biology”, “Xenophobia”, “Bacteriophage”, “Prion”, “Virus”, “Bacteria”, “Parasite”, “Agent”, “Gene”, “Disease”, “Microscopic”, “Transmission”, “Symptom”, “Infection”, “Infectivity”, “Lethality”, “Severity”, “Vector”, “Antibody”, “Antibiotics”, “Vaccine”, “Pandemic”, “Epidemic”]
#These are the words that’ll be used
lives = 10
#How many guesses you have
guessedletter = []
#Letters that the user has inputted
wordguess = []
#Shows player how long the word is
playerguess = “”
ChosenWord = random.choice(word).lower()
#The word
joinedWord = “”
for i in ChosenWord:
wordguess.append("?")
#Main
while (lives != 0 and “?” in wordguess):
joinedWord = “”.join(wordguess)
print(joinedWord)
print(“Please input a letter”)
letterinput = input().lower
if letterinput == wordguess:
print(“You got a correct letter, well done.”)
print(wordguess)
letterinput.append(playerguess)
for x in range(len(ChosenWord)):
if playerguess == ChosenWord[x]:
wordguess[x] = playerguess
if playerguess not in ChosenWord:
lives = lives - 1
print(“Do you want to play again? Y or N”)
responce = input()
if responce == “N”:
Game = False
else:
Game = True
The only difference is I fixed a Spelling mistake in the source code but not the file.