forked from Abbyfade/SCA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RockPaperScissors.py
69 lines (57 loc) · 3.25 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
67
68
69
import random
def RockPaperScissors():
options = ["rock", "paper", "scissors"]
ComScore = 0
UserScore = 0
print("Welcome to the Rock, Paper, Scissors game!")
user = input("Enter your name: ")
check = input("Enter yes to play or quit to end the game: ").lower()
while check == "yes":
s = random.randint(0, 2)
UserSelection = input("Enter Rock, Paper, or Scissors: ").lower()
if UserSelection not in options:
print("You didn't enter any of the options given")
check = input("Enter yes to play or quit to end the game: ").lower()
else:
print("computer picks {}".format(options[s].title()))
if options[s] == UserSelection:
print("It's a tie")
print("Computer : {x} {user}: {y}".format(x=ComScore, user = user, y=UserScore))
check = input("Enter yes to keep playing or quit to end the game: ").lower()
elif options[s] == "rock" and UserSelection == "scissors":
ComScore += 1
print("Computer wins!")
print("Rock smashes Scissors")
print("Computer : {x} {user}: {y}".format(x=ComScore, user = user, y=UserScore))
check = input("Enter yes to keep playing or quit to end the game: ").lower()
elif options[s] == "rock" and UserSelection == "paper":
UserScore += 1
print("You win!")
print("Paper covers Rock")
print("Computer : {x} {user}: {y}".format(x=ComScore, user = user, y=UserScore))
check = input("Enter yes to keep playing or quit to end the game: ").lower()
elif options[s] == "paper" and UserSelection == "rock":
ComScore += 1
print("Computer wins!")
print("Paper covers Rock")
print("Computer : {x} {user}: {y}".format(x=ComScore, user = user, y=UserScore))
check = input("Enter yes to keep playing or quit to end the game: ").lower()
elif options[s] == "paper" and UserSelection == "scissors":
UserScore += 1
print("You win!")
print("Scissors cuts Paper")
print("Computer : {x} {user}: {y}".format(x=ComScore, user = user, y=UserScore))
check = input("Enter yes to keep playing or quit to end the game: ").lower()
elif options[s] == "scissors" and UserSelection == "rock":
UserScore += 1
print("You win!")
print("Rock smashes Scissors")
print("Computer : {x} {user}: {y}".format(x=ComScore, user = user, y=UserScore))
check = input("Enter yes to keep playing or quit to end the game: ").lower()
elif options[s] == "scissors" and UserSelection == "paper":
ComScore += 1
print("Computer wins!")
print("Scissors cuts Paper")
print("Computer : {x} {user}: {y}".format(x=ComScore, user = user, y=UserScore))
check = input("Enter yes to keep playing or quit to end the game: ").lower()
RockPaperScissors()