Hi! I'm Ken. I'm here to help you learn to program in MOO! This tutorial is for Absolute Beginners, no previous programming experience in any language is assumed! MOO, despite all the Bovine jokes you may have heard or made yourself, actually stands for 'Multi-user Object Oriented' programming language... MOO is kind of a cross between C++ and LISP, but much easier to learn. When you learn to program in MOO you can build all kinds of fun things! This is an INTERACTIVE tutorial! You will actually be coding a program while you watch the tape! Here's how it works. I will suggest a line or two of code for you to write. I will then ask you to pause the tape and actually enter the code before resuming your viewing. To pause or resume viewing this tape at any time type PAUSE TVNAME or RESUME TVNAME. Why not practice doing it now.. Were you able to pause and resume without problems? Great! Let's get started. Oh, I just remembered. . Many people prefer to have the tv pause automatically after each line. If you would like to try this type: autopause tvname Type: resume to continue each time... For our first programmed object let's make a Box of Donuts! It's real easy. Just type: @create $thing named Box of Donuts,donuts Type: inv to look at your inventory to make sure you've got it. You should see it listed there. In the language of object oriented programming you just made a 'child' of the generic object $thing. The word 'donuts' is the alias or nickname for your object. Let's make sure that nickname 'donuts' really works. Type: drop donuts Now type: look donuts Hee, hee....Not a very appetizing description so far is it.. Let's change that boring description! Type: @describe donuts as "You see a box of yummy scrumptious donuts begging to be eaten" The next thing we'll do is create several kinds of donuts for inside the box. Type a line like the one that follows adding as many donut descriptions as you wish. @property donuts.kinds {"yummy cherry donut","tasty mooberry croissant","creamy custard donut"} What we just did was add a property called 'kinds' to the object 'box of donuts'. This property is a list of 3 donut descriptions. Now let's see if you were successful. Type: @dump donuts Do you see a property called 'kinds' with the correct donut descriptions? If you don't, try adding the property again... Now that we have added the property, let's practice talking like real MOO programmers and describe what we did Repeat after me: 'We added the PROPERTY 'kinds' to the OBJECT 'donuts' and INITIALIZED the property's VALUE to a LIST of CHARACTER STRINGS describing various donuts' Hey! Are we cool or what! Now let's see if we can add an EAT verb to our donuts object so we can gobble up some of those donuts! Our EAT verb might be called like this 'eat donuts'. To create the verb type: @verb donuts:eat this Now let's make the verb DO something! When a player eats a donut let's have the player choose a donut kind at random and gobble it up. I will show you the complete program but don't type it in just yet... Here it is: donut_choice = this.kinds[random(3)]; player.location:announce_all(player.name," gobbles up a ",donut_choice,"."); Let's talk about what's happening here before we try to enter the code... In line 1 random(3) generates a random number from 1 to 3. ( If you had 5 donuts in your box you would make this random(5).) Let's suppose the function came up with the number 2.. The variable 'donut_choice would then be set to the second item in the list 'this.kinds', that is, the value of 'donut_choice' would now be "tasty mooberry croissant" When a player eats a randomly selected donut everyone in the room should be informed of this event. This is the job of the second line. In line 2 'player.location' is the location of the player who is eating the donut, usually some room. The verb 'announce_all' is a verb defined for all rooms and it means 'tell everybody in the room' something or other.. If Jill had typed 'eat donut' all players in the room (including Jill) would see 'Jill gobbles up a tasty mooberry croissant.' Now lets program that verb! You will need to type in the three lines I will show you followed by a period on a line by itself. The first line actually creates a new verb named EAT and assigns it to the object 'donuts'. You will be prompted for the remaining two lines. Don't forget to end with a period on a separate line.. Type: @program donuts:eat donut_choice = this.kinds[random(3)]; player.location:announce_all(player.name," gobbles up a ",donut_choice,"."); If you were successful you will get my FAVORITE message '0 errors, verb programmed'. Congratulations! If you were not so lucky you got some cryptic message about a parse error or whatnot. Just try again.. Did you remember the semicolons at the ends of the lines? Did you get the full colon in the right place? Now let's try out that verb. Type: eat donuts 3 or four times. Yum Yum! Congratulations! You are on your way to becoming a true blue MOO programmer! Next time we will introduce some more fun features of the MOO language and we'll learn how to use the editor! Until then, HAPPY MOOING! Bye bye!