Little Simulator In Cocoa

This is an elevator simulator written as a CocoaWorld. Cocoa has an alternative approach to modeling than that suggested in LittleSimulator.

If you have a Macintosh, try running the simulator applet at http://c2.com/~ward/cocoa/.

A Cocoa world is made up of pieces that live on a grid. It is a little like the GameOfLife except that the marks (pieces) are of various types and you can always define more. The elevator simulator uses these four types of pieces.

The pieces obey rules that are defined by their types. A person has one rule: move into the empty space on your right, if possible. When the world runs, all of the people pieces start marching to the right until they run into something, like an elevator shaft, or a line of other people already there.

One programs Cocoa by demonstrating rules, one by one. Rules can be organized and their evaluation controlled with a grouping structure available in the rule editing window. These are the rules that govern the elevator cars.

The rules say ...


View edit of October 11, 1999 or FindPage with title or text search