Untitled

mail@pastecode.io avatar
unknown
python
3 years ago
1.8 kB
2
Indexable
Never
def winner(): 

if area[0][0]["text"] == "X" and area[0][1]["text"] == "X" and area[0][2]["text"] == "X": 

return "X" 

if area[1][0]["text"] == "X" and area[1][1]["text"] == "X" and area[1][2]["text"] == "X": 

return "X" 

if area[2][0]["text"] == "X" and area[2][1]["text"] == "X" and area[2][2]["text"] == "X": 

return "X" 

if area[0][0]["text"] == "X" and area[1][0]["text"] == "X" and area[2][0]["text"] == "X": 

return "X" 

if area[0][1]["text"] == "X" and area[1][1]["text"] == "X" and area[2][1]["text"] == "X": 

return "X" 

if area[0][2]["text"] == "X" and area[1][2]["text"] == "X" and area[2][2]["text"] == "X": 

return "X" 

if area[0][0]["text"] == "X" and area[1][1]["text"] == "X" and area[2][2]["text"] == "X": 

return "X" 

if area[0][2]["text"] == "X" and area[1][1]["text"] == "X" and area[2][0]["text"] == "X": 

return "X" 

if area[0][0]["text"] == "0" and area[0][1]["text"] == "0" and area[0][2]["text"] == "0":

return "0" 

if area[1][0]["text"] == "0" and area[1][1]["text"] == "0" and area[1][2]["text"] == "0": 

return "0" 

if area[2][0]["text"] == "0" and area[2][1]["text"] == "0" and area[2][2]["text"] == "0": 

return "0" 

if area[0][0]["text"] == "0" and area[1][0]["text"] == "0" and area[2][0]["text"] == "0": 

return "0"

if area[0][1]["text"] == "0" and area[1][1]["text"] == "0" and area[2][1]["text"] == "0": 

return "0" 

if area[0][2]["text"] == "0" and area[1][2]["text"] == "0" and area[2][2]["text"] == "0":

return "0"  

if area[0][0]["text"] == "0" and area[1][1]["text"] == "0" and area[2][2]["text"] == "0": 

return "0" 

if area[0][2]["text"] == "0" and area[1][1]["text"] == "0" and area[2][0]["text"] == "0": 

return "0"

return ""