-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
61 lines (47 loc) · 1.6 KB
/
main.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
import random
scoreWin = 0
scoreLose = 0
while True:
validPlays = ["Rock", "Paper", "Scissors"]
opt = input("Press (R) for Rock, (P) for Paper, (S) to Scissors, (1) to see your Score or (0) to Exit the program: ")
oponent = random.choice(validPlays)
if(opt == '0'):
print("Exiting...")
exit(0)
elif opt in ("r", "R"):
print("You chose Rock.")
print("Your Opponent rolled " + opponent + ".")
if(opponent == "Rock"):
print("It's a Tie!")
elif(opponent == "Paper"):
print("You lost! :( ")
scoreLose += 1
elif(opponent == "Scissors"):
print("You won! :) ")
scoreWin += 1
elif opt in ("p", "P"):
print("You chose Paper.")
print("Your Opponent rolled " + opponent + ".")
if(opponent == "Paper"):
print("It's a Tie!")
elif(opponent == "Scissors"):
print("You lost! :( ")
scoreLose += 1
elif(opponent == "Rock"):
print("You won! :) ")
scoreWin += 1
elif opt in ("s", "S"):
print("You chose Scissors.")
print("Your Opponent rolled " + opponent + ".")
if(opponent == "Scissors"):
print("It's a Tie!")
elif(opponent == "Rock"):
print("You lost! :( ")
scoreLose += 1
elif(opponent == "Paper"):
print("You won! :) ")
scoreWin += 1
elif (opt == '1'):
print( "Wins: {} \nLosses: {}".format(scoreWin, scoreLose) )
else:
print("Invalid Option")