Light Mode
Dark Mode
Impossible game output

One of tests is: ["OOO", "XX.", ".XX"] Witch is impossible in-game input, since in this case game wood finished one move before. Something like this:["OOO",".X.",".XX"]

So my cool algorithm, witch based on counting X and O does't work:

checkio(gr):
    r = gr[0]+gr[1]+gr[2]
    x = r.count("X")
    o = r.count("O")

    if x > o and x+o < 9:
        return "X"
    elif o == x:
        return "O"
    else:
        return "D"
Created: Dec. 22, 2014, 3:26 a.m.
Updated: Nov. 9, 2015, 5:46 p.m.
4
5
User avatar
IvanKoval