repl.it
@anonymous/

JealousFixedBlackbear

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
def v(b):f=sum(b,());w={x[0]for x in b+zip(*b)+[f[::4],f[-3:1:-2]]if len(set(x))==1};return sum(map(`b`.count,w))==len(w)*5

for case in [
    'XOXOXOXOX', 'XOXXOXOXO', 'XOOOOXOXX', 'OXOXOXOXO',  # valid
    'XXXXXXXXX', 'OOOOOOOOO', 'XXXOOOXXX', 'OOOOOXXXX', 'XXOOXOOOX']: #invalid
  print case, v(zip(*([iter(case)]*3)))
  
Fetching token
?