Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. import random
  2. import time
  3. import collections
  4.  
  5. def pics():
  6. if count == 0:
  7. print (" _________ ")
  8. print ("| | ")
  9. print ("| 0 ")
  10. print ("| /| ")
  11. print ("| / ")
  12. print ("| ")
  13. print ("| ")
  14. elif count == 1:
  15. print (" _________ ")
  16. print ("| | ")
  17. print ("| 0 ")
  18. print ("| /| ")
  19. print ("| / ")
  20. print ("| ")
  21. print ("| ")
  22. elif count == 2:
  23. print (" _________ ")
  24. print ("| | ")
  25. print ("| 0 ")
  26. print ("| /| ")
  27. print ("| ")
  28. print ("| ")
  29. print ("| ")
  30. elif count == 3:
  31. print (" _________ ")
  32. print ("| | ")
  33. print ("| 0 ")
  34. print ("| /| ")
  35. print ("| ")
  36. print ("| ")
  37. print ("| ")
  38. elif count == 4:
  39. print (" _________ ")
  40. print ("| | ")
  41. print ("| 0 ")
  42. print ("| | ")
  43. print ("| ")
  44. print ("| ")
  45. print ("| ")
  46. elif count == 5:
  47. print (" _________ ")
  48. print ("| | ")
  49. print ("| GAME OVER ")
  50. print ("| YOU LOSE ")
  51. print ("| ")
  52. print ("| ")
  53. print ("| (**)--- ")
  54.  
  55.  
  56. print("Welcome to HANGMAN nHave Fun =)")
  57. print("You can only get 5 wrong. You will lose your :n1. Right Legn2.Left Legn3.Right Armn4.Left Armn5.YOUR HEAD... YOUR DEAD")
  58. print("")
  59.  
  60. time.sleep(2)
  61.  
  62. words = "ferret".split()
  63. word = random.choice(words)
  64.  
  65. w = 0
  66. g = 0
  67. count = 0
  68.  
  69. correct = []
  70. wrong = []
  71. for i in range(len(word)):
  72. correct.append('#')
  73. wrdsplit = list(word)
  74.  
  75. while count < 5 :
  76. pics()
  77. print("")
  78. print("CORRECT LETTERS : ",''.join(correct))
  79. print("WRONG LETTERS : ",wrong)
  80. print("")
  81. print("Please input a letter")
  82. guess = input("> ")
  83. if guess in wrdsplit:
  84. for count in range(len(wrdsplit)):
  85. x = wrdsplit.index(guess)
  86. wrdsplit[x] = '&'
  87. correct[x] = guess
  88. g = g + 1
  89. wrdsplit[x] = '&'
  90. if "".join(correct) == word:
  91. print("Well done... You guessed the word in", g ,"guesses and you got", w , "wrong")
  92. print("YOU LIVED")
  93. break
  94. elif guess not in wrdsplit:
  95. wrong.append(guess)
  96. w = w + 1
  97. g = g + 1
  98. count = count +1
  99.  
  100. pics()
  101. print("The correct word was : ",word)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement