Spring2006.CSCI221Homework1 History

Hide minor edits - Show changes to output

Changed line 2 from:
'''Due Date''': Wednesday, Jan. 25, 2006 \\
to:
'''Due Date''': Friday, Jan. 27, 2006 \\
Changed line 5 from:
(:note Note: | No late days allowed for this assignment.:)
to:
(:note Note: | Up to '''three''' late days may be used for this assignment.:)
Added lines 1-71:
'''Assigned Date''': Thursday, Jan. 19, 2006\\
'''Due Date''': Wednesday, Jan. 25, 2006 \\
'''Due Time''': 11:55pm

(:note Note: | No late days allowed for this assignment.:)

Last modified on {$LastModified} (see [[http://www.cs.cofc.edu/~manaris/index.php/Spring2006/CSCI221Homework1?action=diff&source=n&minor=n | updates]])

!!Purpose

This assignment focuses on Object-Oriented Design and functional cohesion. You are expected to work in isolation (without access to '''any''' resources '''other than''' the class textbook, class notes, and the instructor).

!!Assignment

Design a set of Java classes that implement a game of Tic-Tac-Toe. In our version of the game, two players, human and computer, play in turns, placing X's and O's, respectively, on the 3x3 square board. The human player always goes first. The game goes on until either there is a winner (3 X's or 3 O's in a vertical, horizontal, or diagonal line), or the game is a draw (all squares are occupied and no one has won).

The program should display the current board configuration after each move, e.g.,

| |
X | |
---+---+---
O | |
---+---+---
X | O |
| |

and prompt the user to enter a move (a number from 1 to 9). The human player always goes first. Squares are numbered consecutively, from 1 to 9, where 2 is the middle square in the top row. The program should be as robust as possible. When the game is over it should output a message describing the outcome.

!!Format

Create a document in your favorite word processor with the following standard preamble:

/**
* Author: {Your Name} \\
* Email: {Your email address} \\
* Course: CSCI 221, Section {Your section number} \\
* Assignment: Homework 1 \\
* Due Date: {The assignment's due date} \\
* \\
* Certification of Authenticity <include one of the following}: \\
* \\
* I certify that this work is entirely my own. \\
* \\
* I certify that this work is my own, but I received \\
* some assistance from: {Name(s), References, etc.} \\
* \\
* Purpose: {Provide a simple, yet complete description of the task being \\
* performed by this system. It may be several sentences long.} \\
* \\
* Input: {Provide a simple, yet complete description of the input required \\
* by this system, if any.} \\
* \\
* Output: {Provide a simple, yet complete description of the output generated \\
* by this system, if any.} \\
*/

Next, for each class in your design provide the following:

* @@Class1@@ describe class as per documentation guidelines.
** @@public ''returnType'' method1(parameter1, ...)@@ - describe method as per documentation guidelines.
*** ''Preconditions:'' State assumptions about the arguments (in order for the method to operate correctly), e.g., @@parameter1 > 0 && ...@@
*** ''Postconditions:'' State facts about the effect of the method, if preconditions are met, e.g., @@valueReturned < -5@@.
** ...

!!Submission

You should email a PDF document with your design via email to [[mailto:manaris@cs.cofc.edu]] by the due date.