This is an elevator simulator written as a CocoaWorld. Cocoa has an alternative approach to modeling than that suggested in LittleSimulator. http://c2.com/~ward/cocoa/elevators/world.gif 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. http://c2.com/~ward/cocoa/elevators/types.gif 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. http://c2.com/~ward/cocoa/elevators/rules.gif The rules say ... * first try to load a person, if possible * otherwise either unload a person or continue up or down * finally, if nothing else works, try reversing direction