3.2 Overview: MUF (cont'd)
A First Program:
Let's make a "Hello, world!" program, to practice with the mechanics
of making a program, and because it's something of a rite of
passage.
Make a program. Let's call it tinker.muf, because we'll be tinkering
around with it. Type @prog tinker.muf. The program
is created and you go into the editor. At this point, either type
i to enter `insert' mode and type the code below, or type
q to get our of the editor and quote/paste it into the
MUCK from your host computer, then compile the program and
exit the editor (type c, then q while in the
editor).
====================================
> @prog tinker.muf
Program tinker.muf created with number 1230.
Entering editor.
> i
Entering insert mode.
> (tinker.muf. A practice program)
>
> : main
> me @ "Hello, world!" notify
> ;
> .
> c
Compiler done.
> q
Editor exited.
====================================
Create an action attached to yourself and linked to the program.
====================================
> @act test = me
Action created with number #1231 and attached.
> @link test = tinker.muf
Linked to tinker.muf(#1230FM1)
====================================
Check your program by typing `test'.
====================================
> test
Hello, world!
====================================
prev |
toc |
top |
next
|