tic tac toe winner by m4rk

m=str.split
for g in m(open(0).read(),"\n"):C=lambda S:any(all((n in S)for n in g)for g in m('123 456 789 147 258 369 159 357'));X,O=m(g);print(['CO'[C(O)],'X'][C(X)])

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page