Guest User

Untitled

a guest
Oct 15th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def check_win(game_state, token):
  2. all_rows = [[line[x] for line in game_state] for x in range(len(game_state))] + [game_state[len(game_state)-x-1][x] for x in range(len(game_state))] + [game_state[x][x] for x in range(len(game_state))]
  3. for line in all_rows:
  4. if sum([1 for t in line if t == token]) == len(game_state):
  5. return token
  6. return " "
Add Comment
Please, Sign In to add comment