forked from theutpal01/HacktoberFest2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrockpaperscissors.py
51 lines (48 loc) · 948 Bytes
/
rockpaperscissors.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
50
51
import random
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
player=int(input("What do you choose? Type 0 for Rock, 1 for Paper or 2 for Scissors."))
if player == 0:
print(rock)
elif player == 1:
print(paper)
elif player == 2:
print(scissors)
else:
print("Invalid number!, You lose!")
comp=random.randint(0,2)
if comp == 0:
print(rock)
elif comp == 1:
print(paper)
else:
print(scissors)
game=[player,comp]
if (game[0]==0 and game[1]==2) or (game[0]==1 and game[1]==0) or (game[0]==2 and game[1]==1):
print("You win!")
elif (game[0]==0 and game[1]==0) or (game[0]==1 and game[1]==1) or (game[0]==2 and game[1]==2):
print("Draw!")
else:
print("You lose!")