Rock Paper Scissors
Rock Paper Scissors
science
Jawahar Navodaya Vidyalaya
JALANDHAR
Certificate
this is to certified that the bonafide
work of students in computer science
laboratory during academic session of
2021 - 2022
Name of the group members:-
MEMBERS ROLL No
1.gagandeep kaur 1217
2. shrishti Sharma 1212
3.komal 1223
4. mehak 1224
#importing module
Import random as r
Import time as t
Print(‘\tROCK!,PAPER!,SCISSOR! GAME’)
Dict1={1:’rock’,2:’paper’,3:’scissor’}
Print(‘instruction\nrock>scissor,rock<paper,scissor>pa
per’)
Print(‘press 3 to stop’)
Print()
Player=0
Computer=0
I=1
Round=1
While i==1:#infinite loop
Print(‘\tround’,round)
Wpn=input(‘enter rock or paper or scissor:-
‘).lower()#input
If wpn==’3’:
Break
Else:
Pass#stop loop on particular input (3)
A=r.randint(1,3)#pickup random No. between 1 to 3
Print(‘rock!’,end=’ ‘)
t.sleep(0.5)#delaying output by 0.5 seconds
print(‘paper!’,end=’ ‘)
t.sleep(0.5)#delaying output by 0.5 seconds
print(‘scissor!’,end=’ ‘)
t.sleep(0.5)#delaying output by 0.5 seconds
print(‘shoot!’)
#Result for different kind of combination
If dict1[a]==wpn:
Print(‘comp choose-‘,dict1[a])
Print(‘tie’)
Elif dict1[a]==’rock’ and wpn==’scissor’:
Print(‘comp choose’,dict1[a])
Print(‘Computer Win’)
Computer+=1
Elif dict1[a]==’rock’ and wpn==’paper’:
Print(‘comp choose-‘,dict1[a])
Print(‘Player Win’)
Player+=1
Elif dict1[a]==’paper’ and wpn==’scissor’:
Print(‘comp choose-‘,dict1[a])
Print(‘Player Win’)
Player+=1
Elif dict1[a]==’paper’ and wpn==’rock’:
Print(‘comp choose-‘,dict1[a])
Print(‘Computer Win’)
Computer+=1
Elif dict1[a]==’scissor’ and wpn==’rock’:
Print(‘comp choose’,dict1[a])
Print(‘Player Win’)
Player+=
Elif dict1[a]==’scissor’ and wpn==’paper’:
Print(‘comp choose-‘,dict1[a])
Print(‘Computer Win’)
Computer+=1
Else:
Print(‘invalid input’)
Print()
Print(‘player’,player,’computer’,computer)
Round+=1#no. of round increment
Print()#space
Print()#space