-
Notifications
You must be signed in to change notification settings - Fork 147
/
Copy pathGame.py
80 lines (72 loc) · 1.91 KB
/
Game.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
Snake Water Gun Game
import random
n=5
i=0
l=0
w=0
while i<n:
print("Snake-Water-Gun")
a=['Snake','Water','Gun']
r=random.choice(a)
print("Enter your choice- Snake,Water or Gun")
e=input()
if e=='Snake':
if r=='Water':
print("Your opponent's choice is %s"%r)
print("You got the point\n")
w=w+1
i=i+1
elif r=='Gun':
print("Your opponent's choice is %s"%r)
print("You Lose the point\n")
l=l+1
i=i+1
elif r=='Snake' :
print("Your opponent's choice is %s"%r)
print("Tie..\n")
i=i+1
else:
print("Invalid Input")
elif e=='Water':
if r=='Gun':
print("Your opponent's choice is %s"%r)
print("You got the point\n")
w=w+1
i=i+1
elif r=='Snake':
print("Your opponent's choice is %s"%r)
print("You Lose the point\n")
l=l+1
i=i+1
elif r=='Water':
print("Your opponent's choice is %s"%r)
print("Tie..\n")
i=i+1
else:
print("Invalid Input")
elif e=='Gun':
if r=='Snake':
print("Your opponent's choice is %s"%r)
print("You got the point\n")
w=w+1
i+1
elif r=='Water':
print("Your opponent's choice is %s"%r)
print("You Lose the point\n")
l=l+1
i=i+1
elif r=='Gun':
print("Your opponent's choice is %s"%r)
print("Tie..\n")
i=i+1
else:
print("Invalid Input")
else:
print("Invalid Input")
print("{} no. of chances left".format(n-i))
if w>l:
print("Congrats You Won The Game!")
elif w<l:
print("You lose the Game")
else:
print("It was a Tie")