Tic-Tac-Toe

The all-time classic
What is Tic-Tac-Toe?

Tic-Tac-Toe is a Java Swing GUI (Graphical User Interface) application. Like the classic game, the player tries to win by getting 3 in a row of their game marker. Whether they are X, or O, they will attempt to get 3 in a row, either diagonally, vertically, or horizontally.

Main Features

Tic-Tac-Toe consists of the following features:

  • Full-featured user interface, complete with instructions on how to play the game, as well as strategy tips
  • Two Player mode for fun with friends
  • Classic Tic-Tac-Toe gameplay

Why Tic-Tac-Toe?

Tic-Tac-Toe was made for the Computer Science and Information Systems course 1340 (Introduction to Programming) at Salt Lake Community College. It was made for the assignment titled "Tic-Tac-Toe GUI", where the purpose was to show we could write a Java application using the basic principles we had learned so far. We had not actually gotten into Object Oriented Programming in this class yet, so the code in the original release of this game is... admittedly quite bad. However, it does work, though you can see in some areas where it's a bit sluggish.

While this game does not offer much more than the classic Tic-Tac-Toe experience, it's definitely worth playing simply for the enjoyment of beating your friends at a good 'ol fashioned game of Tic-Tac-Toe!

Demonstration Video

This video was submitted with the project for the assignment, which gives a brief overview of the code behind it, as well as the program itself.

Starting the Game

Tic-Tac-Toe is an application that uses a Graphical User Interface, or GUI. This means that you (the player) will interact with the program by "pointing and clicking" with your mouse cursor.

When you first launch the application, you will immediately be asked to enter your name, and then Player 2 will be asked to enter their name. If no names are entered, the program will default to "Player 1" and "Player 2". From here, you can play the game like any regular Tic-Tac-Toe game, where the objective is to get 3 game markers in a row (either X or O, depending on which one you are). To place your marker, simply click on the button corresponding to the location you would like to place your marker.

Rules

The rules to Tic-Tac-Toe are pretty straightforward, but here they are just in case you don't know how to play:

  1. You play on a three by three game board.
  2. X always goes first.
  3. The first player is known as X and the second is O.
  4. Players take turns putting their marks in empty squares.
  5. The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.
  6. When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends in a tie. The Tie game is referred to as a Cat game.
  7. At the end of the game players will switch what marker they are. X will become O and O will become X.
Strategy

Tic-Tac-Toe is a straightforward game that can seem simple at times, however there can be a bit of strategy involved. This is because you have only a limited number of moves to win the game, and if the other player gets the drop on you, they will either win instead, or prevent you from winning by causing the game to be a tie.

You might consider keeping an eye on where the other player places their markers. That could change what you do next. For example, if the other player gets two markers in a row, you may want to put your next marker in the last empty square in that row, or the other player will win. You are forced to play in a particular square or lose the game. Try to avoid these scenarios by preventing them from occurring in the first place

Helpful Tips
  • Try guessing where your opponnent may place their next game marker so you can plan ahead. Planning ahead can help you determine the best way to win.

  • If possible, try to make a scenario where you have two possibilities to win in your next round. This will ensure your victory, as your opponent only has one opportunity to block you, leaving another one open for you to still win.

  • When not playing with friends, consider playing against yourself a few times by playing as both Player 1 and Player 2. This can help you work out strategies to ensure your victory when you do play with an opponent next!

Download

Before downloading, it is recommended you review the How To Play tab, which explains how to play Tic-Tac-Toe. System Requirements and Installation Instructions can be found below.

This is the latest and recommended version of Tic-Tac-Toe.

Version File Size Date Published Changelog
1.0.0 31 KB December 17, 2017

Tic-Tac-Toe currently has no previous versions available for download.
System Requirements

In order to play Tic-Tac-Toe, you will need the following system specifications.

  • Computer: Anything not a dinosaur
  • Operating System: Windows 7 or newer, macOS 10.8 (Mountain Lion) or newer, or Linux
  • Storage Space: At least 1 MB of free space (seriously, this is a small game)
  • Other: Java 8 Runtime Environment or greater

Installation Instructions

Take the following steps to install Tic-Tac-Toe on your computer:

  1. Download and install the Java 8 Runtime Environment (or greater) if you don't already have it.
  2. Download the Tic-Tac-Toe JAR file to the directory of your choice.
  3. That's it. Now double click the "Tic-Tac-Toe.jar" file to run Tic-Tac-Toe!