Tic Tac Toe
Learn to code the strategy game Tic Tac Toe in Python. This free programming game project includes all of the code, images and audio files required.
Starter Code Files
Download and unzip this Python starter code file to your Tic Tac Toe project folder
Images and Audio
Download and unzip these image and audio files to your Tic Tac Toe project folder
Book of Code
Copy the Tic Tac Toe program from the Book of Code into your IDE
1. String Concatenation
Learn how to join Python strings together to give the user more meaningful messages and feedback.
Watch First: Alien Invasion Strings
2. Displaying Text
Learn how to display text on screen using Pygame and build the Tic Tac Toe scoreboard.
Watch first: Alien Invasion Coordinates
Introducing Echo Show 5 – Compact smart display with Alexa, White, available on Amazon
3. Parameter Passing 2
n Python a parameter is a variable which is declared within a function definition. This tutorial explains more about Python parameters and how they are used within Tic Tac Toe functions.
Watch first: Alien Invasion Parameter Passing
4. 2D Lists
You have already learned that a list in Python is a structure for storing multiple data items. In this video we explain how to use a 2D Python list to store the Tic Tac Toe game board.
Watch first: Golf Hole Strokes List
5. Nested Loops
You have already learned that a for loop in Python is used to repeat something a certain number of times. In this tutorial we explain how to use a nested for loop.
Watch first: Golf For Loop
6. While Loops
A while loop continues to repeat while a certain condition is True. This is different from a for loop which repeats a specific number of times.
Watch First: Golf For Loop
7. Tic Tac Toe Game Design
In this tutorial we explain the design of the Python game of Tic Tac Toe, and discuss the main steps involved in coding the player and computer moves.
Watch First: Golf Move Ball Logic
8. Computer Turn Logic
In this tutorial we explain the logic used to determine the computer turn in the game of Tic Tac Toe.
Watch first: Tic Tac Toe Game Design
9. Winning Line Logic
In this video we explain the logic and Python code required to determine if there are 3 pieces in a row in the game of Tic Tac Toe.
Watch first: Tic Tac Toe 2D Lists
Ring Video Doorbell 2 | 1080p HD Video, Two-Way Talk, Motion Detection, Wi-Fi Connected, available on Amazon