old_contents: #This file contains utility functions for the games
  
  #Check if given user has won
  def hasWon(grid,chip):
      #check same row
      for row in range(0,6):
          sameChip = 0
          for col in range(0,7):
              if grid[row][col] == chip:
                  sameChip += 1
                  if sameChip == 4:
                      return True
              else:
                  sameChip = 0
  
      #Check same column
      for col in range(0,7):
          sameChip = 0
          for row in range(0,6):
              if grid[row][col] == chip:
                  sameChip += 1
                  if sameChip == 4:
                      return True
              else:
                  sameChip = 0
  
new_contents: #This file contains utility functions for the game play thread
  
  #Check if given user has won
  def hasWon(board,chip):
      #check horizontal
      for col in range(0,6):
          for row in range(0,4):
              if board[row][col] == chip and board[row+1][col] == chip and board[row+2][col] == chip and board[row+3][col] == chip:
                  return True
      #check vertical
      for col in range(0,6):
          for row in range(0,4):
              if board[row][col] == chip and board[row][col+1] == chip and board[row][col+2] == chip and board[row][col+3] == chip:
                  return True
      #check / diagonal
      for row in range(0,4):
          for col in range(3, 6):
              if board[row][col] == chip and board[row+1][col-1] == chip and board[row+2][col-2] == chip and board[row+3][col-3] == chip:
                  return True
      #check \ diagonal
      for row in range(0,4):
          for col in range(0,3):
              if board[row][col] == chip and board[row+1][col+1] == chip and board[row+2][col+2] == chip and board[row+3][col+3] == chip:
                  return True
      return False
  
subject: add function to check for win