Advertisement
Guest User

aaaa

a guest
Jun 8th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. wins = 1
  2. losses = 1
  3. winloss = 0
  4. import winsound
  5. import time
  6. import pygame
  7.  
  8. ###################################################################
  9.  
  10. #Opens username/password text files and defines username.txt
  11. #as "user" and password.txt as "password"
  12.  
  13. def rps():
  14. f = open("username.txt","r")
  15. user = f.read()
  16. f.close()
  17.  
  18. f = open("password.txt","r")
  19. password = f.read()
  20. f.close()
  21.  
  22. game = input("What game do you want to play?")
  23. if game == "rock paper scissors":
  24. rps()
  25. else:
  26. print ("reee")
  27. exit()
  28.  
  29. #A new variable to determine if the input is the same as the
  30. #username/password in the txt files
  31.  
  32. userCheck = input("Please enter your username")
  33. passwordCheck = input("Please enter your password")
  34.  
  35. time.sleep(3)
  36.  
  37. print("0####0000000000000000####0000000000000000############0000000000000000################0000")
  38. time.sleep(0.25)
  39. print("0####0000000000000####000000000000000000##############000000000000000000000####0000000000")
  40. time.sleep(0.25)
  41. print("0####000000000####000000000000000000000####00000000####00000000000000000000####0000000000")
  42. time.sleep(0.25)
  43. print("0####000000####00000000000000000000000####0000000000####0000000000000000000####0000000000")
  44. time.sleep(0.25)
  45. print("0####000####0000000000000000000000000####000000000000####000000000000000000####0000000000")
  46. time.sleep(0.25)
  47. print("0####0####00000000000000000000000000####00000000000000####00000000000000000####0000000000")
  48. time.sleep(0.25)
  49. print("0#######000000000000000000000000000########################0000000000000000####0000000000")
  50. time.sleep(0.25)
  51. print("0####0####000000000000000000000000##########################000000000000000####0000000000")
  52. time.sleep(0.25)
  53. print("0####0000####00000000000000000000####00000000000000000000####00000000000000####0000000000")
  54. time.sleep(0.25)
  55. print("0####0000000####0000000000000000####0000000000000000000000####0000000000000####0000000000")
  56. time.sleep(0.25)
  57. print("0####0000000000####000000000000####000000000000000000000000####000000000000####0000000000")
  58. time.sleep(0.25)
  59. print("0####0000000000000####00000000####00000000000000000000000000####00000000000####0000000000")
  60. time.sleep(0.25)
  61. print("0####0000000000000000####0000####0000000000000000000000000000####0000################0000")
  62.  
  63. #If the username and password in the txt files are the same as
  64. #the username and password inputted by the user, then it will
  65. #print access granted and allow you to use the program, if not
  66. #then it will print invalid username/password and quit the program.
  67.  
  68. if (user) == (userCheck) and (password) == (passwordCheck):
  69. print ("Access permitted. Welcome",user)
  70. else:
  71. print ("Invalid username/password. Access denied.")
  72. exit()
  73.  
  74. ###################################################################
  75.  
  76. while True:
  77. import random
  78. from random import randint
  79.  
  80. choice = int(input("1 = rock 2 = paper 3 = scissors"))
  81. choicePC = random.randint(1,3)
  82.  
  83. #Rock outcomes
  84.  
  85. if (choice) == 1 and (choicePC) == 1:
  86. print ("The computer chose Rock. Draw!")
  87.  
  88.  
  89. if (choice) == 1 and (choicePC) == 2:
  90. print ("The computer chose Paper. Loss!")
  91. losses = losses +1
  92.  
  93. if (choice) == 1 and (choicePC) == 3:
  94. print ("The computer chose Scissors. Win!")
  95. wins = wins +1
  96.  
  97. #Paper outcomes
  98.  
  99. if (choice) == 2 and (choicePC) == 1:
  100. print ("The computer chose Rock. Win!")
  101. wins = wins +1
  102.  
  103. if (choice) == 2 and (choicePC) == 2:
  104. print ("The computer chose Paper. Draw!")
  105.  
  106. if (choice) == 2 and (choicePC) == 3:
  107. print ("The computer chose Scissors. Loss!")
  108. losses = losses +1
  109.  
  110. #Scissor outcomes
  111.  
  112. if (choice) == 3 and (choicePC) == 1:
  113. print ("The computer chose Rock. Loss!")
  114. losses = losses +1
  115.  
  116. if (choice) == 3 and (choicePC) == 2:
  117. print ("The computer chose Paper. Win!")
  118. wins = wins +1
  119.  
  120. if (choice) == 3 and (choicePC) == 3:
  121. print ("The computer chose Scissors. Draw!")
  122.  
  123. #Secret outcome
  124. if (choice) == 4:
  125. print ("8===D Penis beats everything. Epic gamer win!")
  126. wins = wins + 100
  127.  
  128. winloss = wins/losses
  129. winsound.Beep(200, 750)
  130. winsound.Beep(300, 750)
  131. winsound.Beep(400, 750)
  132. winsound.Beep(32767, 750)
  133.  
  134. #Stats
  135.  
  136. print ("--------------------------")
  137. print ("")
  138. print ("Win Total:",wins)
  139. print ("Loss Total:",losses)
  140. print ("W/L Ratio:",winloss)
  141. print ("")
  142. print ("--------------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement