input: Write a function to develop an AI Tic-Tac-Toe game using Python. The function should include the following sub-functions: drawBoard(board) to print the Tic-Tac-Toe board, checkWin(board, player) to check if a player has won the game, getComputerSpot(board, player) to determine the AI's move, and playGame() to facilitate the overall game flow. The function playGame() should alternate between the human player (denoted by 'X') and the computer player (denoted by 'O'), and it should check for a win condition or a draw after each move.
  assert playGame()
  assert checkWin(['-', 'X', 'X', 'X', '-', '-', '-', '-', '-', '-'], 'X') == True
  assert checkWin(['-', 'O', 'O', 'O', '-', '-', '-', '-', '-', '-'], 'O') == True
  assert checkWin(['-', '-', '-', '-', '-', '-', '-', '-', '-', '-'], 'X') == False
  assert checkWin(['-', 'X', 'O', 'X', 'O', 'X', 'O', 'X', 'O', 'X'], 'X') == True
  assert getComputerSpot(['-', 'X', 'O', 'X', '-', 'O', '-', '-', '-', '-'], 'O') in [3, 5, 7, 8, 9]
  assert getComputerSpot(['-', '-', '-', '-', '-', '-', '-', '-', '-', '-'], 'O') in [1, 2, 3, 4, 5, 6, 7, 8, 9]
output: def drawBoard(board):
      print(f"{board[1]}|{board[2]}|{board[3]}")
      print("-+-+-")
      print(f"{board[4]}|{board[5]}|{board[6]}")
      print("-+-+-")
      print(f"{board[7]}|{board[8]}|{board[9]}")
  
  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] == '-']
      return random.choice(available_spots)
  
  def playGame():
      board = ['-'] * 10
      players = ['X', 'O']
      current_player = 0
      while True:
          drawBoard(board)
          if players[current_player] == 'X':
              spot = int(input("Enter your move (1-9): "))
          else:
              spot = getComputerSpot(board, players[current_player])
          if board[spot] == '-':
              board[spot] = players[current_player]
              if checkWin(board, players[current_player]):
                  drawBoard(board)
                  print(f"{players[current_player]} wins!")
                  return
              if all(board[i] != '-' for i in range(1, 10)):
                  drawBoard(board)
                  print("It's a draw!")
                  return
              current_player = 1 - current_player
          else:
              print("Invalid move, try again.")