code: def isWon(state, who):
      
      for w in WINS:
          S = sum(1 if (w[k] == 1 and state[k] == who) else 0
                  for k in range(ACTIONS))
          if S == 3:
              # We have a win
              return True
      # There were no wins so return False
      return False
docs: Test if a tic-tac-toe game has been won.
      
      Assumes that the board is in a legal state.
      Will test if the value 1 is in any winning combination.