##project to build rock, paper and scissor game
##created by Sparsh 'awesome' Sethi
##uses knowledge of functions, lists, in-built random library and else-if statements.
## part_1 : we first define function, define user input, call a random value using random library
def game():
import random
options=['rock','paper','scissor']
move=input("choose rock, paper or scissor ")
x=random.randrange(0,3)
comp_move=options[x]
print("the opponent chose...",comp_move)
print()
## part_2 : now we place the conditions and define the rules of the game
if comp_move=='rock':
if move.lower()=='rock':
print("DRAW")
elif move.lower()=='paper':
print("congrats, paper beats rock")
print("YOU WIN THIS ROUND")
elif move.lower()=='scissor':
print("oh no, rock crushes scissor!")
print("YOU LOSE THIS ROUND")
else:
print("YOU HAVE ENTERRED A INVALID OPTION")
if comp_move=='scissor':
if move.lower()=='rock':
print("congrats, rock crushes scissor")
print("YOU WIN THIS ROUND")
elif move.lower()=='scissor':
print("DRAW")
elif move.lower()=='paper':
print("oh no, scissor cuts paper")
print("YOU LOSE THIS ROUND")
else:
print("YOU HAVE ENTERRED A INVALID OPTION")
if comp_move=='paper':
if move.lower()=='rock':
print("oh no, paper beats rock!")
print("YOU LOSE THIS ROUND")
elif move.lower()=='paper':
print("DRAW")
elif move.lower()=='scissors':
print("congrats, scissors cuts paper")
print("you win this round")
else:
print("YOU HAVE ENTERRED A INVALID OPTION")
print()
print()
## part_3 : calling the function
answer="yes"
while answer.lower()=="yes":
game()
answer=input("would you like to play again? ")
print()
print()
print()