Artificial Intelligence: Modeling with Tic-Tac-Toe

CSEF · 2011 Mathematics & Software

Overview

Objectives/Goals This science experiment is to determine if a computer can outplay a human player in a game of Tic-Tac-Toe after it has been programed to play. My hypothesis is: if a computer is taught some basic Tic-Tac-Toe algorithms, it will win at a higher rate against a human player. I used this hypothesis because it is assumed that a computer will play better. If it has been programed correctly, then it will always refer back to those algorithms and perform them exactly as they were supposed to be used. Methods/Materials I used my Windows 7 laptop and notepad. I set up the game board with buttons representing the squares. I made a square to contain an X or O whenever it has been clicked and switch between X and O. I made the program alternate turns when someone clicked a square. I created a button that would start a new game when it was clicked. I added the artificial intelligence to the game. Three people each played 10 games against the computer. I recorded who won and lost, or if it was a tie and compared the overall ratios of wins to losses of each person. Results I found that my hypothesis was rejected because the human players, overall, played better than the computer. For example, in matches 2 and 3, the ratios of the human players were 2:1 and 1:0, while the computer#s ratios were 1:2 and 0:1. Conclusions/Discussion I concluded that the computer played poorly because of two very important weaknesses: first, it didn#t see a trap that could be used by the human player to win; and, second, it didn#t take the advantage to trap its opponent.

Summary statement

I programmed my computer to play Tic-Tac-Toe against a human player.

Help received

Uncle taught me computer programming.

Competition history

  • CSEF 2011 Mathematics & Software · Entry J1413

Resources

Related projects

Closest projects by meaning, across every fair and year in the corpus.

Browse more like this

Source: California Science & Engineering Fair public projects

Save projects to your library

Sign in with Google to keep track of projects you find interesting, organized into folders. An account also raises your daily allowance for “Has this been done?”, and lets you create a key for the MCP server with a much higher limit than anonymous use. Browsing stays public.

Continue with Google