-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock Paper Scissors.py
More file actions
81 lines (74 loc) · 2.27 KB
/
Copy pathRock Paper Scissors.py
File metadata and controls
81 lines (74 loc) · 2.27 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import random
rock = '''
rock
,--.--._
------" _, \___)
/ _/____)
\//(____)
------\ (__)
`-----"
'''
paper = '''
paper
/') ./')
/' /.--''./'')
:--'' ; ''./'')
: ' ''./')
: ''./'
:--''-..--'''' '''
scissors = '''
scissors
.-. _
| | / )
| |/ /
_|__ /_
/ __)-' )
\ `(.-')
> ._>-'
/ \/ '''
game = int(input("Enter your choice (0 for rock, 1 for paper, 2 for scissors): "))
action = ["rock", "paper", "scissors"]
ation = ["rock", "paper", "scissors"]
if game < 0 or game > 2:
print("Enter a valid input (0, 1, or 2).")
else:
user_action = action[game]
comp_action = random.choice(ation)
print(f"You chose: {user_action}")
print(f"Computer chose: {comp_action}")
if user_action == "rock" and comp_action == "scissors":
print("You", rock)
print("Computer", scissors)
print("You win!")
elif user_action == "rock" and comp_action == "rock":
print("You", rock)
print("Computer", rock)
print("It's a draw")
elif user_action == "rock" and comp_action == "paper":
print("You", rock)
print("Computer", paper)
print("You lose!")
elif user_action == "paper" and comp_action == "scissors":
print("You", paper)
print("Computer", scissors)
print("You lose!")
elif user_action == "paper" and comp_action == "paper":
print("You", paper)
print("Computer", paper)
print("It's a draw")
elif user_action == "paper" and comp_action == "rock":
print("You", paper)
print("Computer", rock)
print("You win!")
elif user_action == "scissors" and comp_action == "rock":
print("You", scissors)
print("Computer", rock)
print("You lose!")
elif user_action == "scissors" and comp_action == "paper":
print("You", scissors)
print("Computer", paper)
print("You win!")
elif user_action == "scissors" and comp_action == "scissors":
print("You", scissors)
print("Computer", scissors)
print("It's a draw")