-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset
42 lines (37 loc) · 855 Bytes
/
set
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
import random
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 == 'g':
return False
elif you == 's':
return True
elif comp == 'g':
if you == 's':
return False
elif you == 'w':
return True
print("computer: snake(s) water(w) or gun(g) ? ")
randno = random.randint(1,3)
if randno == 1:
comp = 's'
elif randno == 2:
comp = 'w'
elif randno == 3:
comp = 'g'
you = input("player turn: snake(s) water(w) or gun(g) ?")
a = gamewin(comp,you)
print(f"computer choose {comp}")
print(f"you choose {you}")
if a == None:
print("game id tie!")
elif a:
print("you win!")
else:
print("you loose!")