Captions:
Figure 1 ± The Rules Of Ergo

Three legal moves are shown at left: White jumps (gray arrow), black replicates (white arrow), or black jumps and captures (black arrow).  After the latter, all six pieces in the lower left quadrant of the board would be black.

Figure 2 ± Creating A User Interface For Ergo

In Interface Builder, a large Window called ªThe Boardº was created, as were a whole set of new subclasses of View. These classes had no contents yet, but were created so their names could be used as labels. Next, a whole array of CustomViews were pulled off the palette, named, and placed to form the squares of the board. (Each square will compute its row and column from where it is located in the window.) A subclass of Application, called ErgoApp, was created with a single outlet for holding onto the boardWindow (shown connected above) and was then made the File's Owner. Finally, Interface Builder was used to create prototype .h and .m files for all the new classes to start off their implementation.

Figure 3 -- The Class Hierarchy and Protocol of Ergo

Each class (box) above is titled with its class name, is connected to its superclass, and is filled with the names of its key messages (these messages appear in bold in Listings 1±4). All of Ergo's classes are subclasses of View or Application, standard AppKit classes. (Most of the work of Ergo has already been done for us by NeXT, in the AppKit.) Classes with the prefix Abstract store common behaviour but by convention do not expect to have instances. (EmptySquare objects will appear in a running copy of Ergo, but AbstractSquare objects will not.) The distinction between messages grouped in the upper rectangle of a class and the lower one is that the upper messages are thought of as being public, available to any and all other objects, whereas the lower messages are private, and are useful only to the other objects in Ergo that directly need them. This distinction is a useful comment to later readers of your object about which messages you consider safe for common use, and which may have undocumented side effects.