Programming Assignment 1
SE 510 Principles and Applications of Software Design
Fall 2009

Tic-Tac-Toe

This programming assignment is to design a Tic-Tac-Toe game in Java. A Tic-Tac-Toe wiki article can be found at  Tic-Tac-Toe Wiki which describes how to play the game in details. Tic-Tac-Toe is a board game of two players on a board of 3 x 3 intersections. The players alternate in marking the spaces using X for player 1 and O for player 2. The player who has marked three spaces in a horizontal, vertical, or diagonal row wins the game.

Let us assume the following:

  1. Two players: Player 1 using X and Player 2 using O, each unmarked space is marked with a "-" dash.
  2. Player 1 always makes the first mark on the board,
  3. The spaces are labeled from the left top corner as (0, 0) and bottom right corner as (2, 2),
  4. A player marks a space by entering the label of the space, row_# column_# , separated with a single space.

Graphical user interface is not required for this assignment. You may choose your own appropriate user interface. A text-based display is acceptable. For example, if Player 1 and Player 2 have entered the following:

2 1             // Player 1
0 1             // Player 2
1 1             // Player 1

the board would be printed like the following:

 012
0-O-
1-X-
2-X-

The server stops the game and displays the winner when a winning situation is determined by the server. It is optional to highlight the winning three marked spaces in some fashion, e.g., in bold face or different color.

To submit your assignment, email the instructor (biy1@scranton.edu) and ATTACH your source files to the email. The subject of your email should appear like “SE 510 Assignment 1 – Team #: members' lastnames”. Correctly naming your file and following submission procedure is considered part of the assignment requirements.

Note:

You may want to keep the following in mind when you design the program for this assignmnet
    1. Next assignment will employe the client-server architecture to change this to a online game.
    2. We will then allow the system to host more than one game at the same time
    3. Eventually, the system may allow other two-player-board games, such as connect-five.
    4. Design reusable components.