-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrock_paper_scissor.py
160 lines (89 loc) · 2.07 KB
/
rock_paper_scissor.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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
import random
random_float = random.random()
print(random_float)
print(random_float * 12)
import random
def rock():
print("""
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
""")
def paper():
print("""
_______
---' ____)____
______)
_______)
_______)
---.__________)
""")
def scissor():
print("""
_______
---' ____)____
______)
__________)
(____)
---.__(___)
""")
# 1 == Rock
# 2 == Paper
# 3 == Scissor
# Paper Beat Rock
# Scissor Beat paper
# Rock Beat Scissor
def rock_paper_scissor(user_input):
comp_gen = random.randint(1, 3)
if (user_input == comp_gen):
print("Match Tie")
elif (user_input == 1) and (comp_gen == 2):
print("Paper Beat Rock. You Are Losser")
paper()
elif (user_input == 2) and (comp_gen == 3):
print("Scissor Beat Paper. You Are Losser")
scissor()
elif (user_input == 3) and (comp_gen == 2):
print("Scissor Beat paper. You Are Winner")
scissor()
elif (user_input == 2) and (comp_gen == 1):
print("Paper Beat Rock. You Are Winner")
paper()
elif (user_input == 1) and (comp_gen == 3):
print("Rock Beat Scissor. You Are Losser")
scissor()
elif (user_input == 3) and (comp_gen == 1):
("Rock Beat Scissor. You Are Winner")
scissor()
print("Select 1. Rock 2. Paper 3. Scissor")
print("""
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
""")
print("""
_______
---' ____)____
______)
_______)
_______)
---.__________)
""")
print("""
_______
---' ____)____
______)
__________)
(____)
---.__(___)
""")
print()
user_input = int(input("Enter Your Number Rock/Paper/Scissor : "))
print()
print(rock_paper_scissor(user_input))