Skip to content

Commit b74bfcb

Browse files
authored
Merge pull request DeepNinja07x#6 from MasterMeet/patch-1
SnakeWaterGunGame
2 parents 9bf9a38 + a92bc8f commit b74bfcb

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

SnakeWaterGunGame

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Snake Water Gun Game Devlopement
2+
import random
3+
NoOfRound = 10
4+
user = 0
5+
comp = 0
6+
7+
while NoOfRound > 0:
8+
print("---------------------------------")
9+
print("Choices:\nS-Snake\nW-Water\nG-Gun")
10+
c = input("Enter Your Choice:-")
11+
choice = c.capitalize()
12+
13+
if choice in ('S', 'W', 'G'):
14+
15+
n = random.randint(1, 3)
16+
17+
if (choice == 'S' and n == 1) or (choice == 'W' and n == 2) or (choice == 'G' and n == 3):
18+
print("Draw")
19+
20+
elif choice == "S":
21+
if n == 2:
22+
print("Congratulations. You Won!")
23+
user += 1
24+
else:
25+
print("Better Luck Next Time!")
26+
comp += 1
27+
28+
elif choice == "W":
29+
if n == 3:
30+
print("Congratulations. You Won!")
31+
user += 1
32+
else:
33+
print("Better Luck Next Time!")
34+
comp += 1
35+
36+
else:
37+
if n == 1:
38+
print("Congratulations. You Won!")
39+
user += 1
40+
else:
41+
print("Better Luck Next Time!")
42+
comp += 1
43+
44+
else:
45+
print("Invalid Choice")
46+
continue
47+
NoOfRound -= 1
48+
49+
print("---------------------------------")
50+
51+
if user == comp:
52+
print("Draw!")
53+
elif user > comp:
54+
print("Hurray. You won!")
55+
else:
56+
print("You Lost!")
57+
58+
print("---------------------------------")
59+
60+
print("Scoreboard")
61+
print("Your Score:-", user, "\nComputer's Score:-", comp )
62+
63+
print("---------------------------------")
64+
65+
66+
67+
68+
69+
70+
71+

0 commit comments

Comments
 (0)