-
Notifications
You must be signed in to change notification settings - Fork 0
/
TIC_TAC_TOE.py
56 lines (48 loc) · 1.23 KB
/
TIC_TAC_TOE.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
from random import randint, choice
print('V= Scissors, O= Rock, W= Paper')
name = input('Enter play: ').upper()
game = ['V', 'O', 'W']
LT = []
def computerplay():
X = choice(game)
return X
def winxlose(player,comp):
if player == 'V':
if comp == 'V':
return 'Draw'
elif comp == 'O':
return 'Lose'
elif comp == 'W':
return 'Win'
elif player == 'O':
if comp == 'V':
return 'Win'
elif comp == 'O':
return 'Draw'
elif comp == 'W':
return 'Lose'
elif player == 'W':
if comp == 'V':
return 'Lose'
elif comp == 'O':
return 'Win'
elif comp == 'W':
return 'Draw'
else:
return 'Make the right choice'
def res(L):
return count(L)
while name != 'END':
compplay= computerplay()
print('Player Plays: ', name)
print('Computer Plays: ', compplay)
result= winxlose(name,compplay)
print(result)
LT.append(result)
print('')
print('V= Scissors, O= Rock, W= Paper, End= End game')
name = input('Enter Play: ').upper()
possibility = ['Win', 'Lose', 'Draw']
for a in possibility:
no= LT.count(a)
print(a, no)