Comp 212 Lab 11: Tournament Tree Milestone 2


The main purpose of this lab is to let you work with one or two other lab partners to get started on milestone 2 of programming project #3.  Most of the effort should be spent on implementing the algorithm for playing a round in the Tournament tree.  You are allowed to work in teams of two or three during the lab session and share the code with your lab partners.  Do feel free to share your milestone 1 code with your lab partners.  After the lab session, you are to take your lab code and work alone to complete milestone 2  for programming project #3.  

Tournament View

The main GUI component to add here is a JPanel to display a tree horizontally.  Use the given BRSDisplayAdapter and BRSGetMaxDepthAdaptor to display the tree.  You should be able to augment your milestone 1 code and test the display panel here.

Tournament Model

The main focus should be on the algorithm to play a round.  It is really a matter of understanding the description of the algorithm and then implement it one small step at a time.  Think anonymous inner classed all the way.  With inner classes you have direct access to the closure, and as a result, you do not have to set up ways to "memorize" the context and pass all kinds of parameters to your visitors: you have less to keep track of.  Knowing how to use inner classes effectively will transform you into formidable OO programmers! :-)

Tournament Tree Controller

Depending on how you set up the controller in milestone 1, there is very little to be done here!

D. X. Nguyen, Nov. 11, 2001