-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMAIN_CODE
80 lines (61 loc) · 2.83 KB
/
MAIN_CODE
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
import random
lst = [1,2,3]
nc = 0
computer_point = 0
your_point = 0
print("=======================================================================================\n=======================================================================================")
print(" \b \n \n \t \t \t \t SNAKE,WATER,GUN GAME\n \n")
print("=======================================================================================\n=======================================================================================")
c = int(input("HOW MANY TIMES U WANT TO PLAY?"))
# making the game in while
while nc < c:
print("1 for Snake \n2 for water \n3 for gun\n4 for Exit \n")
i = int(input('Snake,Water,Gun: '))
r = random.choice(lst)
if i == r:
print("Tie \n ")
print(f"computer_point is {computer_point} and your point is {your_point} \n")
elif i == 1 and r == 3:
computer_point = computer_point +1
print(f"your choice is SNAKE and computer guess is GUN \n")
print("computer wins 1 point \n")
print(f"computer_point is {computer_point} and your point is {your_point} \n")
elif i == 1 and r == 2:
your_point = your_point + 1
print(f"your choice is SNAKE and computer guess is WATER \n")
print("Human wins 1 point \n")
print(f"computer-point is {computer_point} and your point is {your_point} \n")
elif i == 2 and r == 1:
computer_point = computer_point + 1
print(f"your choice is WATER and computer guess is SNAKE \n")
print("computer wins 1 point \n")
print(f"computer_point is {computer_point} and your points is {your_point} \n")
elif i == 2 and r == 3:
your_point =your_point +1
print(f"your choice is WATER and computer guess is GUN \n")
print("Human wins 1 point \n")
print(f"computer_point is {computer_point} and your point is {your_point} \n")
elif i == 3 and r == 1:
your_point = your_point + 1
print(f"your choice is GUN and computer guess is SNAKE \n")
print("Human wins 1 point \n")
print(f"computer_point is {computer_point} and your points is {your_point} \n")
elif i == 3 and r == 2:
computer_point = computer_point + 1
print(f"your choice is GUN and computer guess is WATER \n")
print("computer wins 1 point \n")
print(f"computer point is {computer_point} and your points is {your_point} \n")
elif i==4:
exit()
else:
print("PLEASE ENTER VALID CHOISE\n")
nc = nc + 1
print(f"{c - nc} is left out of {c} \n")
print("GAME OVER")
if computer_point == your_point:
print("Tie")
elif computer_point > your_point:
print("computer wins and you loose")
else:
print("you win and computer loose")
print(f"your point is {your_point} and computer points is {computer_point}")