input: Write a python function to simulate a Connect Four game and determine the winner.
  assert connect_four([[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[1,1,1,1,0,0,0]])==1
  assert connect_four([[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[1,2,2,2,2,0,0]])==2
  assert connect_four([[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[1,0,0,0,0,0,0],[1,0,0,0,0,0,0],[1,1,1,1,0,0,0]])==1
output: def connect_four(board):
      rows = len(board)
      cols = len(board[0])
      
      def check_winner(player):
          # Check horizontal
          for r in range(rows):
              for c in range(cols - 3):
                  if all(board[r][c + i] == player for i in range(4)):
                      return True
          
          # Check vertical
          for r in range(rows - 3):
              for c in range(cols):
                  if all(board[r + i][c] == player for i in range(4)):
                      return True
          
          # Check diagonal (bottom-left to top-right)
          for r in range(3, rows):
              for c in range(cols - 3):
                  if all(board[r - i][c + i] == player for i in range(4)):
                      return True
          
          # Check diagonal (top-left to bottom-right)
          for r in range(rows - 3):
              for c in range(cols - 3):
                  if all(board[r + i][c + i] == player for i in range(4)):
                      return True
          
          return False
      
      for player in [1, 2]:
          if check_winner(player):
              return player
      
      return 0