Draw tic-tac-toe board

posted Feb 3, 2017, 7:29 AM by Attila Lengyel
def drawBoard(board):
  print("    |   |   ")
  print(" ",board[0],"|",board[1],"|",board[2])
  print("    |   |   ")  
  print("-------------")
  print("    |   |   ")
  print(" ",board[3],"|",board[4],"|",board[5])
  print("    |   |   ")  
  print("-------------")
  print("    |   |   ")
  print(" ",board[6],"|",board[7],"|",board[8])
  print("    |   |   ")  

board = ["X"] * 9
drawBoard(board)
Comments