-
Notifications
You must be signed in to change notification settings - Fork 0
/
OtherFunction.py
41 lines (40 loc) · 1023 Bytes
/
OtherFunction.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
#Random.randint() to print radom number every time
#you have to import random
import random
def snakewatergun(computer,player):
if computer == player:
return None
elif computer == 's':
if player == 'w':
return False
elif player =='g':
return True
elif computer == 'w':
if player == 'g':
return False
elif player == 's':
return True
elif computer == 'g':
if player == 's':
return False
elif player == 'w':
return True
print("Computer Turn")
rand = random.randint(1, 3)
#print(rand)
if rand == 1:
computer="s"
elif rand == 2:
computer="w"
if rand == 3:
computer="g"
player=input("Player Turn \n")
game=snakewatergun(computer,player)
print(f"Computer {computer}")
print(f"Player {player}")
if game==None:
print("Game Draw")
elif game:
print("Player Win")
else:
print("Player Loose Game")