600.321/421, Object Oriented Systems
Smalltalk Assignment 2: Mind-Boggling
Due: Thursday Oct 8th, by midnight

Before doing this assignment it is strongly suggested you have read Chapters 7-8 of Liu.

Your assignment is to code a version of the game "Boggle".
Here is how Boggle is played, in case you haven't ever experienced the Joy of Boggle.

Your implementation is going to be a single-user variation on the above. Since there is a fair amount of the Smalltalk library you will need to use and there is not a whole lot of time, we give some hints to help on that aspect.

Design and Coding Style

You should use the CRC method to produce an initial design proposal. Be aware that the English description above leaves out a huge amount of detail; here is a bit of an elaboration.

An initial grid of random characters must be generated. A list of word guesses must be maintained during the game play, and both checked against the 4x4 grid to make sure the word occurs, and checked against a dictionary, at the end of the game. Checking a word against the grid will require finding all possible starting points for the word and traversing from there in all possible next directions to see if there is any direction to proceed for match. . . .
Try to keep your design and final code as close to the object-spirit of the informal English as you can. For instance, nextDirections could be a method which returned aList of all the gridLocation's that can be reached from the currentGridLocation. Also, make Boggle and Grid be unique classes -- it is good not to overload the "main" class (Boggle here) with too much functionality.

At this point in your Smalltalk coding career, it is good to go overboard with keeping to the spirit of the high-level description -- make method names as evocative as possible, and make a class for every different possible object-concept.

Please use hashing to implement a fast word dictionary lookup (big hint: Smalltalk Sets use hashing for lookup...).

See the coding style suggestions in lecture. You will be expected to follow those points.

Submission Instructions

Turn in your CRC design in class the following Monday, as a stapled set of 3x5's, paper, or a printout. We promise to be extremely liberal in grading your CRC analyses; use this as a chance to warm up to the concepts.

For your code, use the file out as.. menu option on the class category list to file out your class category as Assignment2.st, and then submit this file from hops via the precise (no exceptions in names, please) hops command

~scott/bin/submit Assignment2 Assignment2.st
(The general format for this command is the name of the assignment followed by the file(s) submitted)

You will need to ftp your files to hops first if you are working on some other machine.

Don't submit a .im file, they are too big! Use the file in/out tool instead.

You can check what files you submitted via

All of your solutions should work in VisualWorks Smalltalk 3.0.