Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/python3
- # http://jumpto.cc/rps-go
- hangmans = [
- """
- ____
- | |
- |
- |
- |
- |
- ------
- """,
- """
- ____
- | |
- | O
- |
- |
- |
- ------
- """,
- """
- ____
- | |
- | O
- | |
- |
- |
- ------
- """,
- """
- ____
- | |
- | O
- | /|
- |
- |
- ------
- """,
- """
- ____
- | |
- | O
- | /|\\
- |
- |
- ------
- """,
- """
- ____
- | |
- | O
- | /|\\
- | /
- |
- ------
- """,
- """
- ____
- | |
- | O
- | /|\\
- | / \\
- |
- ------
- """,
- ]
- incorrectGuesses = [] # empty list, we will put things inside it later
- correctGuesses = []
- guesses = len(hangmans)
- print("Enter your word:")
- word = input().upper()
- print("\n" * 30) # Clear the screen by printing 30 new lines
- print(hangmans[-guesses]) # Print the empty hangman
- while guesses > 1:
- print()
- for letter in word: # Loop through the word
- if letter in correctGuesses:
- print(letter + " ", end="")
- else:
- print("_ ", end="")
- print()
- print("Guess a letter:")
- guess = input().upper()
- if guess in word:
- print("Correct!")
- if guess not in correctGuesses:
- correctGuesses.append(guess)
- else:
- print("Incorrect!")
- guesses -= 1
- incorrectGuesses.append(guess)
- print(hangmans[-guesses])
- print("Guessed:")
- print(incorrectGuesses)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement