Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Revisited KvaNTy's Straight and primitive solution in Creative category for Xs and Os Referee by suic
# Inspired by http://www.checkio.org/mission/x-o-referee/publications/KvaNTy/python-3/straight-and-primitive/
# Thanks KvaNTy :)
def checkio(data):
try:
check = lambda i: len({data[i[j]][i[j+1]] for j in range(0, 6, 2)}) == 1 and data[i[0]][i[1]] != "."
inp =[[0,0,0,1,0,2],
[1,0,1,1,1,2],
[2,0,2,1,2,2],
[0,0,1,0,2,0],
[0,1,1,1,2,1],
[0,2,1,2,2,2],
[0,0,1,1,2,2],
[2,0,1,1,0,2]]
res = next(filter(check, inp))[:2]
return data[res[0]][res[1]]
except StopIteration:
return 'D'
Feb. 18, 2015
Comments: