forked from Airiuwu/Rock-Paper-Scissors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrockpaperscissors.py
66 lines (53 loc) · 1.8 KB
/
rockpaperscissors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import os, ctypes, random
from playsound import playsound
if os.name =='nt':
os.system('cls')
ctypes.windll.kernel32.SetConsoleTitleW(f"Rock! Paper! Scissors!")
userScore, botScore = 0, 0
while True:
choices = ["Rock", "Paper", "Scissors"]
result = ["Tied!", "Lost!", "Won!"]
invalidSongs = ["android", "omg"]
idiot = random.choice(invalidSongs)
botChoice = random.choice(choices)
os.system('cls')
userChoice = (input("Choose one! Rock, Paper or Scissors\n"))
if userChoice not in choices:
playsound(f'sounds/{idiot}.wav')
print("That is not a valid option!")
exit()
elif userChoice == botChoice:
result = result[0]
playsound('sounds/bruh.wav')
elif userChoice == choices[0] and botChoice == choices[1]:
result = result[1]
botScore += 1
playsound('sounds/fart.wav')
elif userChoice == choices[0] and botChoice == choices[2]:
result = result[2]
userScore += 1
playsound('sounds/lessgo.wav')
elif userChoice == choices[1] and botChoice == choices[2]:
result = result[1]
botScore += 1
playsound('sounds/fart.wav')
elif userChoice == choices[1] and botChoice == choices[0]:
result = result[2]
userScore += 1
playsound('sounds/lessgo.wav')
elif userChoice == choices[2] and botChoice == choices[0]:
result = result[1]
botScore += 1
playsound('sounds/fart.wav')
elif userChoice == choices[2] and botChoice == choices[1]:
result = result[2]
userScore += 1
playsound('sounds/lessgo.wav')
os.system('cls')
print(f"Your Choice: {userChoice} | Bot Choice: {botChoice}\nYou {result}\n\nYour Score: {userScore} | Bot Score: {botScore}")
retry = input("Would you like to play again? (Y/N): ")
if retry not in ["y", "Y", "Yes"]:
print("See you next time!")
break
else:
playsound("sounds/yeahyeah.wav")