pyBegin / projects / tictactoe

Tic-Tac-Toe

Two implementations of the classic 3×3 game:

190 linesRunnable

Tic-Tac-Toe

Two implementations of the classic 3×3 game:

Example

Terminal version:

Welcome to Tic Tac Toe!
Do you want to be X or O?
X
The player will go first.
   |   |
-----------
   |   |
-----------
   |   |
What is your next move? (1-9)
5
   |   |
-----------
   | X |
-----------
   |   |
...
Hooray! You have won the game!
Do you want to play again? (yes or no)
no

GUI version: A Tkinter window opens with a 3×3 grid of buttons; click a cell to place your mark (X or O image tile), and the computer responds immediately.

How to run on localhost

python Tic-Tac-Toe-Terminal/main.py     # terminal version
python TicTacToe-GUI/tic\ tac.py        # GUI version

Dependencies