Charles Sturt 
University AussieMOO


Object-Oriented Programming at AussieMOO


Background: The LambdaMOO programming language was developed as a research project at Xerox Parc Palo Alto Research Center by Pavel Curtis in 1990, and remains the most popular MOO server source code and MOO database core.

MOOcode, a hybrid of C++ and LISP, is an object oriented programming language designed to be both flexible and accessible to less experienced users. Pavel used many of the strengths of other OO languages like Smalltalk and C++, in the design of the MOO programming language.

You may borrow a temporary player name and password for this practical,
if you have not successfully completed the tutorial.


A Cautionary Tale

Mutli-User Domains such as MOO can be socially addictive.

Be aware that AussieMOO is for serious communication and object-oriented programming experiences. This does not preclude your learning from being fun or an enjoyable social experience, but avoid time-wasting and excessive use, otherwise use of this MOO will be restricted, and such action is not part of the philosophy of the Internet or the Wizard crew of AussieMOO.


I am gradually moving and upgrading this tutorial, the links on the titles for each section are to the new pages. -- Archwizard.

Getting Started

  1. Start Netscape and find this practical at
    http://silo.riv.csu.edu.au/mooprac2.html OR
    http://farrer.riv.csu.edu.au/amoo/tut/mooprac2.html
  2. The AussieMOO Home page at http://farrer.riv.csu.edu.au/aussiemoo.html is also a useful online reference.
  3. Connect to AussieMOO (farrer.riv.csu.edu.au:7777) as a player. Login as
    co player password
  4. Save a log file as moo2.log using your MOO client software.
  5. Adjust the size of the Netscape and MOO client windows.
  6. Use @gender and @describe me as to change your appearance and check it with look me
  7. Teleport to Computer Lab2: room #3011 using @go #3011
  8. Use @who and @map to look where every user is located.

Single and Multiple Inheritance

Inheritance is a relationship between two classes of objects, such that one of them, the CHILD, inherits all of the relevant features of the other class, called the PARENT. Each class is a particular type of object. For example all player objects are desc endants of the $player class. You can see your player class with the @parents command, which lists all classses back to the Root class:

@parents me
Hopper(#293)   generic wizard(#57)   generic programmer(#58)   generic builder(#4)
Frand's Player Class(#296)   generic player(#6)   Root Class(#1)
Player Classes exist as a MOO Character Hierarchy (from least to most power):

Guest
Disciple/student
Player 
Builder 
Programmer 
Wizard (an administrator): Elmyra, Hopper, Infostud, Tantrist, SunWiz 
ArchWizard: AussieBunny 

If you are unhappy with a parent, you can change your player class with the @chparent command.

The MOO is single inheritance system, where every object has exactly one parent and is related to other objects along one branch. It makes sense really - how can you be both a a room and a player at the same time? Smalltalk and C++ , however, exhibit mult iple inheritance capability.

An Object-oriented World

People are objects. Your understanding of OO concepts will be enhanced at AussieMOO as you behave as an object in an OO world, something that MOO has over Smalltalk and C++. Even the award-winning C++ programming course at the GNA uses the Diversity Unive rsity MOO for tutorial assistance. [Nevermind, those languages get their own back with other features such as the OO property of multiple inheritance]

An OBJECT is usually an abstraction of a real-world entity. Everything is an object in a MOO. Players, Rooms, Exits, Entrances, Directions, Editors and so on. Each object has an OBJECT NUMBER in the MOO database eg Computer Lab1 is object number #3153. Th e object number can be substituted for the object name at any time.

A CLASS is a collection of objects having common features. A good example is the set of player classes of archwizard, wizard, programmer, builder and guest. This is a skill-based hierarchy. When you connect to AussieMOO as a new user, and successfully wor k your way through the Tutorial Caverns (another object with object number of #1126), you can then change your get your own MOO player object, by changing your parent class from guest to player. For higher levels such as programmer and wizard are awarded to experienced players on request to a player of class wizard.

The MOO database core starts off with basic object types called GENERICS. As you create new objects, the class is defined. Typical generic objects are $thing, $player, $room, $note and $container. The $root_class is the ROOT CLASS where all objects begin. If I wanted to create a computer object in the current room using the $note class:

			@create $note named "computer"
If I wanted to create to create a computer SUBCLASS, the command is:

			@create "computer" named "macintosh"
			@create "computer" named "compaq"

Use @classes to see all the public classes available for use

Use @realm to see all the parenting tree

OBJECT-ORIENTED MODELLING: A Room with a view

  1. Use the text editor called Simpletext to name and design a room with a view that has a window and some in it items such furniture and works of art.
  2. For each object in the room, determine its parent class from the generic classes of $thing, $player, $room, $note and $container and create a lyrical desription for the room and all of its objects. Consider the relationships of the objects eg a desk o bject ($container) has computer on it ($thing or $note)

OBJECT-ORIENTED PROGRAMMING: A Room with a view

  1. Use @dig to build the room object. Add the object number to your notes eg my attic is (#662).
  2. Teleport to your new room by using its object number: eg @go #662
  3. Is it a nice place to call home? Use @sethome to make this room your place to go to at future logins to AussieMOO
  4. Use @describe here as to describe the room. Check with the look command.
  5. Add an object using @create named eg @create $container named dresser
  6. The inventory command will tell you the things you are carrying
  7. Enter drop eg drop dresser and the dresser object is now part of the current room.
  8. Enter @describe as eg @describe dresser as You see a mirror on the mahogany dresser
  9. Enter look dresser to read its new description.
  10. Enter look to see that the new object has been added to the room's description.
  11. Repeat steps 4 to 9 for each object as needed in your model.
  12. To get rid of an object, use @recycle When you delete an object, its object number is recycled (MOO is environmentally-friendly - recycling instead of destroying!!)
  13. Create north and south exits from this new room to the room with a view. Use @dig to build the room next door. Note the object number
  14. Teleport to the new room with the @go command
  15. Enter @connect south to # (from builder in new room)
  16. Teleport back to your room with a view.
  17. Enter @connect north to # (from builder in room with a view)
  18. Use @create $note named poster, to make a poster with a message on it
  19. Use @describe poster as eg @describe poster as a laminated map of the world
  20. Enter write "" on poster eg Enter write "The map has the world divided into Time Zones of computer conferencing" on poster You can now use TWO verbs with that $note object: look and read. Only the owner of the note can write on it or erase it The $note object class defines those verbs for us, as a CHILD of $note. The argument specifiers are read, write and erase.

    MatheMOOtics

    OO programming languages can do mathematical calculationsand logical operations . Numbers are objects. Use the eval verb to do some simple sums.

    The ; is used as a shortcut, like say " and emote :

    Try entering the following statements on the MOO:


    *NOTE* You must be a programmer to use eval *

    1. eval 10 + 5
    2. ;45/3
    3. ;(6+5)*3
    4. ;(7*6) + (101-62)
    && (AND), || (OR) and ! (NOT) are the familiar logical operators. Try entering the following statements on the MOO:

    1. eval 1 && 2
    2. eval 0 && 2
    3. eval 1 || 0
    4. eval ! (2>3)

    Shutdown Process

    1. Enter
      @quit
      to end the MOO session. Close down MOO client using File/Quit
    2. Similarly close down Netscape and other programs.
    3. Send the moo2.log, file (or both files) for assessment to keustace@wis.riv.csu.edu.au using e-mail, along with any evaluation comments. [This can be done before next week, if time is short]

    • © Lyceum Project, Ken Eustace, 1997
    • Last amended - 22nd May 1997 (keustace@csu.edu.au)
    • Maintained by - Ken Eustace