Skip to content

Commit 106094a

Browse files
authored
Merge pull request larymak#126 from implosion07/main
Rock paper and scissor game
2 parents a14841e + 2c4da5f commit 106094a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#ROCK PAPER SCISSOR GAME
2+
#PLAYER VS CPU
3+
import random
4+
a=0
5+
b=0
6+
print("WELCOME TO THE ROCK-PAPER-SCISSOR.........\nTHIS IS YOU VS PC THE 1ST ONE TO GET SCORE OF 5 WINS\nLETS START...")
7+
while True:
8+
print("ENTER r-ROCK p-PAPER s-SCISSOR")
9+
a1=input()
10+
n=random.randrange(-10000,10000,1)
11+
if n%2==0 and n<=0:
12+
b1='r'
13+
if n%2!=0 and n<=0:
14+
b1='p'
15+
if n>=0 :
16+
b1='s'
17+
if a1=='r' and b1=='r' or a1=='p' and b1=='p'or a1=='s' and b1=='s':
18+
print("CURRENTLY A: ",a,"B: ",b)
19+
continue
20+
if a1=='r' and b1=='p':
21+
b=b+1
22+
if a1=='r' and b1=='s':
23+
a=a+1
24+
if a1 == 'p' and b1=='r':
25+
a=a+1
26+
if a1 == 'p' and b1 == 's':
27+
b = b + 1
28+
if a1 == 's' and b1 == 'r':
29+
b = b + 1
30+
if a1 == 's' and b1 == 'p':
31+
a = a + 1
32+
print("CURRENTLY \nA: ",a,"\nB: ",b)
33+
if a==5:
34+
print("A won")
35+
break
36+
if b==5:
37+
print("PC won")

0 commit comments

Comments
 (0)