input: Write a function to play an AI Tic-Tac-Toe game using Python where the board is represented by a list of size 10 and the players play alternatively. The function should check for a win after each move, and if no moves are left, declare the game as a draw. The function should handle user input for the human player and randomly select spots for the computer player if no winning move is available.
  assert checkWin(['-', 'X', 'X', 'X', '-', '-', '-', '-', '-', '-'], 'X')==True
  assert checkWin(['-', '-', '-', '-', 'O', 'O', 'O', '-', '-', '-'], 'O')==True
  assert checkWin(['-', '-', '-', '-', '-', '-', '-', '-', '-', 'X'], 'X')==True
  assert getComputerSpot(['-', '-', 'X', '-', '-', '-', '-', '-', '-', '-'], 'O')==1
  assert getComputerSpot(['-', 'O', 'X', 'X', '-' 'O', 'X', 'X', 'O', 'O'], 'O')==None
  playGame()
output: def checkWin(board, player):
      win_patterns = [(1, 2, 3), (4, 5, 6), (7, 8, 9), (1, 4, 7), (2, 5, 8), (3, 6, 9), (1, 5, 9), (3, 5, 7)]
      for pattern in win_patterns:
          if all(board[i] == player for i in pattern):
              return True
      return False
  
  def getComputerSpot(board, player):
      import random
      available_spots = [i for i in range(1, 10) if board[i] == '-']
      if not available_spots:
          return None
      return random.choice(available_spots)
  
  def playGame():
      board = ['-'] * 10
      players = ['X', 'O']
      current_player = 0
      
      while True:
          if players[current_player] == 'X':
              spot = int(input("Enter your move (1-9): "))
              while board[spot] != '-':
                  spot = int(input("Invalid move. Enter your move (1-9): "))
          else:
              spot = getComputerSpot(board, 'O')
              if spot is None:
                  print("Game is a draw!")
                  break
          
          board[spot] = players[current_player]
          if checkWin(board, players[current_player]):
              print(f"Player {players[current_player]} wins!")
              break
          
          if all(board[i] != '-' for i in range(1, 10)):
              print("Game is a draw!")
              break
          
          current_player = 1 - current_player