Tic-Tac-Toe Game Example 1

Game where user wins

$ python3 tictactoe.py
-----------------------
Welcome to Tic-Tac-Toe!
-----------------------

Enter your choice like the numbers below:

 0 | 1 | 2
-----------
 3 | 4 | 5
-----------
 6 | 7 | 8

Computer chooses: 8

   |   |
-----------
   |   |
-----------
   |   | O

Enter 0-8 for your choice: 8
You must choose an empty location!
Enter 0-8 for your choice: -1
You must choose a location between 0 and 8!
Enter 0-8 for your choice: 10
You must choose a location between 0 and 8!
Enter 0-8 for your choice: 4

   |   |
-----------
   | X |
-----------
   |   | O

Computer chooses: 7

   |   |
-----------
   | X |
-----------
   | O | O

Enter 0-8 for your choice: 6

   |   |
-----------
   | X |
-----------
 X | O | O

Computer chooses: 3

   |   |
-----------
 O | X |
-----------
 X | O | O

Enter 0-8 for your choice: 2

   |   | X
-----------
 O | X |
-----------
 X | O | O


You win!