Comp202: Principles of Object-Oriented Programming II
Fall 2006 -- Project #5: Games 4 Two   


This project is not about Tic-Tac-Toe nor Othello.  It uses a 2-person game design as a vehicle to learn BIGGER concepts in computing:

In this project, you will be given a big chunk of a 2-person board game framework and asked to write a few of its components, plug them in and obtain a program that can run Tic-Tac-Toe and Othello with different types of players, human and/or computer, using a variety of strategies to compute the next move while playing the games.  See the on-line demo!!  (You are not allowed to reverse engineer the demo to do your project).

The given game framework abstracts and decouples the different components in a game and specifies them in terms of interfaces with only pure abstract behaviors.  For example, the rules of a game is abstracted and encapsulated in an interface called IBoardModelABoardModel is a specific implementation of this interface using the state pattern.  Playing a particular board game is a matter of writing a concrete subclass of ABoardModel and plug it into the framework.  Nothing in the framework is changed!

Pair Programming

You are allowed and strongly encouraged to work in teams of at most 2 people. 


Othello Game rules: From Pressman Games, the manufacturer
Web page of an Othello fanatic:

You are given the following.

  1. The source code of most of the game framework: P5M1Source.jar.  You can extract all the files from this jar file by enter the command:
  2. Among the source files is which is the class that encapsulates:

    An important piece of code in is stubbed out.  You will be required to complete it.

  3. The UML and javadoc that describes framework design.
  4. The binary class files of the complete framework: P5M2.jar.  You are allowed to reverse engineer it to study the design, but not to reverse engineer the code.
  5. The binary class file for the TicTacToe game board:  tttboard.jar.  It contains the class files for TicTacToeBoard, a class that you will be required to implement (i.e. write the code).

Your task for this project is to do the following.

  1. Fill out the stubs in the (in the "model" package), i.e. instantiate the IRequestor object.  The upcoming lab (lab #11) will help you with this part.
  2. Implement the Tic-Tac-Toe board model by completing the provided skeleton
  3. Implement a random move strategy that selects a move from the set of legal (i.e.valid) moves only.  Hint: take a look at and the stubbed out file.
  4. Implement MinMax principle.
  5. Implement Alpha-Beta pruning strategy.
  6. Implement Depth-limited search strategy that works for any specified depth..
  7. has a method called getPlayers().  In this method, the code to add players playing the strategies described in items 3, 4, 5 in the above is commented out.  These strategies must be written in such a way that when this code fragment is uncommented, the whole will compile and run properly.
  8. Be sure to document (in javadoc style) all the code you write.

Use the user ID of one of the team members as the package name for all of the above strategies.

See the Hints on INextMoveStrategies page!


Milestone 1 Requirements:  See Class Schedule for submission time and date


Backup your entire milestone 1 folder BEFORE commencing on milestone 2! 


Milestone 2 Requirements: See Class Schedule for submission time and date

No late submission will be accepted.  The submission should contain the following:

All submissions MUST contain the following:

Othello Tournament

During the week of the final, we will hold a tournament to select a new Othello champion.  Participation is totally optional.

P4M2.jar is the binary that will be used for the Othello tournament.  To run the code, enter the following command (on Owlnet Solaris  machines).

java -classpath .:P5M2.jar:tttboard.jar controller.GameApp

In Windows, the command is

java -classpath .;P5M2.jar;tttboard.jar controller.GameApp

We will announce the tournament rules later.  One key rule is for you to use your user id as the package name for your best Othello next move strategy.

If you would like a reasonably challenging opponent (though not a tournament-winning capable one), download the following jar file:   comp202prof.jar.     Add this jar file to the "Extra Classpaths" in your DrJava Preferences/Resource Locations.  To load the strategy, load in the following class name after Othello starts up:  comp202prof.SBW_DXN_strategy1


Tips and Traps

In no particular order...


Last Revised Thursday, 03-Jun-2010 09:52:20 CDT

©2006 Stephen Wong and Dung Nguyen