-
Notifications
You must be signed in to change notification settings - Fork 16
/
Game1.py
47 lines (38 loc) · 893 Bytes
/
Game1.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
# snake, water, gun game
def gamewin(comp, you):
if comp==you:
return None
elif comp== 's':
if you == 'w':
return False
elif you == 'g':
return True
elif comp== 'w':
if you == 's':
return True
elif you == 'g':
return False
elif comp== 'g':
if you == 'w':
return True
elif you == 's':
return False
import random
rndm=random.randint(1, 3)
if rndm==1:
comp="s"
elif rndm==2:
comp="w"
elif rndm==3:
comp="g"
print("computer chossed and now,")
you=input("your turn : Snake(s) Water(w) Gun(g) ?")
a=gamewin(comp, you)
print(f"computer choose {comp}")
print(f"you choosed {you}")
if a== None:
print("Become's tie")
elif a == True:
print("You Win !!")
else:
print("You lose!")