-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRPS.py
75 lines (67 loc) · 2.45 KB
/
RPS.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
70
71
72
73
74
75
import random
#Printing Rules
print("...rock...")
print("...paper...")
print("...scissors...")
print("...please enter it in lower case...")
#Game Choice of One Player or Two Player
game_choice = input("One Player or Two Player? ")
#Take Input and Computer Choice
p1_choice = input("(enter Player 1's choice): ")
if game_choice == "one player":
com_choice = random.choice(["rock", "paper", "scissors"])
elif game_choice == "two player":
p2_choice = input("(enter Player 2's choice): ")
if game_choice == "one player":
print("(Computer's choice): " + com_choice)
print("SHOOT!")
if game_choice == "one player":
#Rock Set
if p1_choice == "rock" and com_choice == "rock":
print("It's a Tie!")
elif p1_choice == "rock" and com_choice == "scissors":
print("Player 1 wins!")
elif p1_choice == "rock" and com_choice == "paper":
print("Computer wins!")
#Scissors Set
elif p1_choice == "scissors" and com_choice == "rock":
print("Computer wins!")
elif p1_choice == "scissors" and com_choice == "scissors":
print("It's a Tie!")
elif p1_choice == "scissors" and com_choice == "paper":
print("Player 1 wins!")
#Paper Set
elif p1_choice == "paper" and com_choice == "rock":
print("Player 1 wins!")
elif p1_choice == "paper" and com_choice == "scissors":
print("Computer wins!")
elif p1_choice == "paper" and com_choice == "paper":
print("It's a Tie!")
#Else Statement
else:
print("Please enter a valid choice.")
if game_choice == "two player":
#Rock Set
if p1_choice == "rock" and p2_choice == "rock":
print("It's a Tie!")
elif p1_choice == "rock" and p2_choice == "scissors":
print("Player 1 wins!")
elif p1_choice == "rock" and p2_choice == "paper":
print("Player 2 wins!")
#Scissors Set
elif p1_choice == "scissors" and p2_choice == "rock":
print("Player 2 wins!")
elif p1_choice == "scissors" and p2_choice == "scissors":
print("It's a Tie!")
elif p1_choice == "scissors" and p2_choice == "paper":
print("Player 1 wins!")
#Paper Set
elif p1_choice == "paper" and p2_choice == "rock":
print("Player 1 wins!")
elif p1_choice == "paper" and p2_choice == "scissors":
print("Player 2 wins!")
elif p1_choice == "paper" and p2_choice == "paper":
print("It's a Tie!")
#Else Statement
else:
print("Please enter a valid choice.")