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.
The AussieMOO Home page at http://farrer.riv.csu.edu.au/aussiemoo.html is
also a useful online reference.
Connect to AussieMOO (farrer.riv.csu.edu.au:7777) as a player. Login as
co player password
Save a log file as moo2.log using your MOO client software.
Adjust the size of the Netscape and MOO client windows.
Use @gender and @describe me as to change your appearance and check it with look me
Teleport to Computer Lab2: room #3011 using @go #3011
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):
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.
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
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.
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
Use @dig to build the room object. Add the object number to your notes eg my attic is (#662).
Teleport to your new room by using its object number: eg @go #662
Is it a nice place to call home? Use @sethome to make this room your place to go to at future logins to AussieMOO
Use @describe here as to describe the room. Check with the look command.
Add an object using @create named eg @create $container named dresser
The inventory command will tell you the things you are carrying
Enter drop
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 *
eval 10 + 5
;45/3
;(6+5)*3
;(7*6) + (101-62)
&& (AND), || (OR) and ! (NOT) are the familiar logical operators. Try entering the following statements on the MOO:
eval 1 && 2
eval 0 && 2
eval 1 || 0
eval ! (2>3)
Shutdown Process
Enter
@quit
to end the MOO session. Close down MOO client using File/Quit
Similarly close down Netscape and other programs.
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]