-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRPSGame.py
49 lines (42 loc) · 1.31 KB
/
RPSGame.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
# Artin Moghadasi
# @Artin.Projets
import random
RPS= ["rock","paper","scissor"]
round=int(input("Enter number of rounds:"))
for i in range(round):
UserChoice=input("Enter your choice(rock-paper-scissor):")
AIChoice=random.choice(RPS)
print('User Choice:' , UserChoice )
print('AI Choice:' , AIChoice)
AIPoint=0
UserPoint=0
#Draw
if AIChoice=='rock' and UserChoice=='rock':
print("Draw")
elif AIChoice=='paper' and UserChoice=='paper':
print('Draw')
elif AIChoice=='scissor' and UserChoice=='scissor':
print('Draw')
#AI Wins
if AIChoice=='scissor' and UserChoice=='paper':
print('AI Wins')
AIPoint+=1
elif AIChoice=="rock" and UserChoice=='scissor':
print('AI Wins')
AIPoint+=1
elif AIChoice=='paper' and UserChoice=='rock':
print('AI Wins')
AIPoint+=1
#User Wins
if UserChoice=='scissor' and AIChoice=='paper':
print('User Wins')
UserPoint+=1
elif UserChoice=="rock" and AIChoice=='scissor':
print('User Wins')
UserPoint+=1
elif UserChoice=='paper' and AIChoice=='rock':
print('User Wins')
UserPoint+=1
print('AI Point:' , AIPoint)
print('User Point:' , UserPoint)
print("Thanks!"+"\nBye!")