Homework Assignment 5

GUI Front-End to Tic-Tac-Toe

Computer Science II
Object-Oriented Programming

Due: Friday, October 21, at 11:59 PM


This assignment asks you to design and implement a GUI front-end to the Tic-Tac-Toe game. As a starting point, you may use your solution to homework #4, or you may download my solution (solution_hw4.zip). This program should have the same functionality as homework #4. The same Tic Tac Toe specifications apply and are given below.

I encourage you to look at past programs (e.g., MemoPad, CannonGame, etc.) as examples of how the GUI components work. Your best reference might be to read chapter 13 on the AWT API.

Be sure that your submission follows all homework submission requirements.

A Specification for a Program to Play Tic-Tac-Toe

The game of Tic-Tac-Toe consists of two players, usually known as X and O, placing their marks in a 3x3 grid of squares. X goes first, and the players alternate moves. A player wins the game if she marks three squares in a row horizontally, vertically, or diagonally.

Your program should allow the user to play a number of games of Tic-Tac-Toe against the computer, displaying results of the play to the user.

Your initial implementation provide only a few simple behaviors:

Your computer player can choose its move in any way you wish, even randomly. You may implement a "smarter" program if you like!