Advertisement
asweigart

Untitled

Apr 15th, 2019
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. import random
  2. import time
  3. slot = ['BAM!', 'click.', 'click.', 'click.', 'click.', 'click.']
  4. dieMessage = ['You DIED! Thank goodness!', 'Good riddance.', 'My Condolences. You failed.', 'I will tell your parents that you died with honor.', 'I will tell your parents that you died for nothing.', 'Will somebody clean this up?']
  5. surviveMessage = ['YEEEHAW! I ain\'t gon die today!', 'Thank heavens! You didn\'t get your brains blown out!', 'You have not died... YET.', 'This is getting intense.', 'Dang.', 'Maybe next time...']
  6.  
  7.  
  8. playAgain = 'y'
  9. while playAgain.lower() in ('yes', 'y'): # Main game loop:
  10. print('Welcome to Russian Roulette!')
  11. time.sleep(2)
  12.  
  13. # Get the number of players:
  14. while True:
  15. peopleCount = int(input('How many people are playing? (2-6): '))
  16.  
  17. if 2 <= peopleCount <= 6:
  18. break
  19.  
  20. print('You must have at least 2 people and at most 6 people to play!')
  21. time.sleep(2)
  22.  
  23. # Enter the player names:
  24. print('Please state your friends names, one at a time')
  25. person = []
  26. for i in range(peopleCount):
  27. person.append(input('Person #' + str(i + 1) + ': '))
  28.  
  29. # Start game:
  30. print('Welcome, ' + ', '.join(person[:-1]) + ', and ' + person[-1] + '! ')
  31. choosePersonNum = random.randint(0, len(person))
  32. slotNum = random.randint(0, 5)
  33. print('Ok! Let\'s begin!')
  34.  
  35. # Take turns:
  36. while True:
  37. time.sleep(2)
  38. print('It\'s ' + person[choosePersonNum % len(person)] + '\'s turn')
  39. time.sleep(2)
  40. print(slot[slotNum % 6])
  41. time.sleep(2)
  42. if slot[slotNum % 6] == 'BAM!':
  43. print(random.choice(dieMessage))
  44. time.sleep(4)
  45. break
  46.  
  47. print(random.choice(surviveMessage))
  48. time.sleep(4)
  49.  
  50. choosePersonNum = choosePersonNum + 1
  51. slotNum = slotNum + 1
  52.  
  53. print('Would you like to play again?')
  54. playAgain = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement