COMP 110-001 - Introduction to Programming (Spring 2009)

Lab 8

25 points

Assigned: Friday April 3rd

Due: Thursday April 9th by midnight

This lab is designed to give you practice using multi-dimensional arrays.

Description

Download the in-class example TicTacToe.java from the course webpage. Add your name and due date to the Program Header at the top. The program as given allows for a game of Tic Tac Toe to be played on a 3x3 game board. Familiarize yourself with the program by playing a game. Note how the row and column of the current move is specified and how it maps to a location on the game board. This is identical to how 2D arrays are indexed in Java.

Familiarize yourself with the source code and make sure you understand how the game works. Modify the source code in the following ways:

Modify the source code so that the game is played on a 5x5 game board instead of a 3x3 game board. In the case of a 5x5 game board, the condition for winning is that there must be 5 of the same symbol in a single row, column or main diagonal.

Add a third player to the game who will play with the * symbol.

Submission

For this assignment you will need to create a Jar file that contains your source code for TicTacToe.java. Follow these instructions for creating a Jar file.
The Jar file you submit must be named yourlastname_lab8.jar, where yourlastname is your last name

Submit yourlastname_lab8.jar via the UNC Blackboard System under "Assignments → Lab 8" before the deadline.

Grading