Search for Science Fair Projects

1000 Science Fair Projects with Complete Instructions

Computer Science Science Fair Project

Creating an Invincible Tic-Tac-Toe Program

Medium
Creating an Invincible Tic-Tac-Toe Program | Science Fair Projects | STEM Projects
Have you ever wanted to create a computer program that can never lose a game of tic-tac-toe? Well, this project will show you how to do just that! You will use a laptop and a program called MATLAB to create a script that can detect ties, wins, and losses. You will then create a "smart player" using if-then statements to program counter-attacks against moves that would result in a loss. Finally, you will test the efficiency of the "smart player" against random players and humans.

Hypothesis

The hypothesis is that it is possible to create a computer game that never loses, even when it goes second.

Method & Materials

You will create a script that detects ties, wins, and losses. You will create a random player and have the two random players play against each other. You will then analyze strategies and program counter-attacks against moves that would result in a loss. You will then test the efficiency of the "smart player" against random players and humans.
You will need a laptop, the program MATLAB, and a basic understanding of coding.

Results

The results of this project showed that the computer program was successful in that it was able to never lose, as seen when it played three human players. The computer program only tied 19.97% of the games against the random player, and the rest of the games the computer program won. The three human subjects, played against the computer program and never won, tied 86% of the games and lost 14%.

Why do this project?

This science project is unique because it shows how to create a computer program that can never lose a game of tic-tac-toe.

Also Consider

Experiment variations to consider include testing the computer program against more human players and testing the computer program against different strategies.

Full project details

You can find additional information and details for this science fair project here. Have fun exploring!
Share this Science Project:

Related Science Fair Project Ideas

Billiard Ball Paths
Have you ever wondered what happens when you hit a billiard ball from a corner? Find out with this fun science project!
Medium
Examining Gender and Math Ability
Do boys really do better in math than girls? Let's find out!
Medium
To Buy or Not to Buy
Are you trying to decide if it's better to buy or rent a house? This project will help you figure out which is the better financial decision for different incomes.
Medium
Share this Science Project: