-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRPS.py
More file actions
63 lines (53 loc) · 1.43 KB
/
RPS.py
File metadata and controls
63 lines (53 loc) · 1.43 KB
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
name = input("What's your name? ")
import random
RPS = ["r", "p", "s"]
d = {"r": "Rock", "p": "Paper", "s": "Scissors"}
d2 = {"R": "Rock", "P": "Paper", "S": "Scissors"}
beats = {"r": "P", "p": "S", "s": "R"}
vtotal = None
while True:
user = input("Rock, Paper, or Scissors? (R/P/S) : ")
user = user.upper()
AI = random.choice(RPS)
if user == "QUIT":
break
# ohh yeahhh
elif user == "ADHYAYAN":
user = beats.get(AI)
elif user == "R":
pass
elif user == "P":
pass
elif user == "S":
pass
else:
print('''Please enter "r" for rock,
"p" for paper,
or "s" for scissors.
Enter "quit" to quit.''')
continue
def score():
print("AI: ", d.get(AI))
print("You: ", d2.get(user))
def vd(a, b):
if user == AI.upper():
score()
print("Draw")
else:
score()
if user == "R":
if AI == "p":
print("AI Wins.")
else:
print(name, "WINS!")
elif user == "P":
if AI == "s":
print("AI wins.")
else:
print(name, "WINS!")
elif user == "S":
if AI == "r":
print("AI Wins")
else:
print(name, "WINS!")
vd(AI, user)