CSE 1310 - Independent Project Ideas

Tic Tac Toe

Almost everyone is familiar with Tic Tac Toe. If not, a description of the game can be found on this Wikipedia article. As of December 18, 2016, if you Google "Tic Tac Toe", you can play the game right on the Google website, against a computer player.

Your first task is to implement a program that allows two humans to play Tic Tac Toe against each other. Each player, when it is their turn, specifies the move they need to make by providing two numbers (row and column) for their move. The computer must verify that the move is legal (you are not allowed to play on a position where there already is an O or an X). The computer should also check after every move to see if the game is over (i.e., if the last move won the game).

The second stage of this project would be to extend your program, so that a human can play against the computer. You should allow the user to choose if the computer plays first or second. You can start by having the computer make random (but legal) moves. You can then improve by putting in some strategy in the computer moves. Can you make your program smart enough so that the computer never loses? For most other board games, writing a program that never loses can be a challenging or impossible task (this topic is part of the CSE 4308 course on Artificial Intelligence). However, coding a Tic Tac Toe program that never loses is not as hard. It is a moderately difficult but entirely doable task for a CSE 1310 alumnus!

A possible third stage of the project would be to convert it from text-based to a graphical user interface (GUI). See the discussion on graphical interfaces on this website.