💾 Archived View for spam.works › mirrors › textfiles › internet › muck_for.ref captured on 2023-06-14 at 17:25:39.

View Raw

More Information

-=-=-=-=-=-=-

       The MUF Cheat-Sheet, as seen by Sammael (Arthur, The., etc)
                              -or-
           Reference manual for MUCK Forth ("MUF")  -terse

                                                 v2.2 August 4, 1990
ENTERING EDITING MODE
	@prog <program name>	(creates a new program if none match)
	@edit <program name or number>

EDITING COMMANDS
	<number> i				insert before <number>
	.					exit insert mode
	c					compile
	<number1> <number2> l			list
	<number1> <number2> d			delete
	<letter> <letter>   a			show macros (abridged)
	<letter> <letter>   s			show macros (long)
	<program#> v				view program header
	h					help on edit mode
	u					uncompile
	q					quit editor mode

PRIMITIVE TERMINOLOGY

	v					type variable
	d					type dbref
	i					type int (boolean)
	s					type string
	a					type address (word)

SYNTAX

	( ... )					commments
        :					begin user-def word
        ;					end user-def word
	var <VARNAME>				variable declaration

        if 		( i -- )
	else		( -- )
        then 		( -- )
        exit 		( -- )
	execute		( a -- ??? )
	pop 		( x -- )
	dup 		( x -- x x )
	swap 		( x y -- y x )
	over		( x y -- x y x )
	rot		( x y z -- y z x )
	rotate		( ni ... n1 i -- n(i-1) ... n1 ni )
	pick		( ni ... n1 i -- n1 ni )
	put		( ni ... n1 x i -- x ... n1 )

        !		( x v -- )		store value x in var v.
						value may be any type data
        @ 		( v -- x )		fetch value x from var v
	atoi 		( s -- i )		string --> integer
        intostr 	( i -- s )		integer || dbref --> string
	dbref 		( i -- d )		integer --> dbref
	int 		( x -- i )		VAR || object --> integer
	variable 	( i -- v )		integer --> VAR ref

	+ - * / %	( i1 i2 -- i )   	
        < > = <= >= 	( i1 i2 -- i )
	strcmp,
           stringcmp    ( s1 s2 -- i ) 		strcmp == case sens.
	strncmp		( s1 s2 n -- i )	compares only n letters
	number? 	( s -- i )
	dbcmp		( d1 d2 -- i )
        and  or 	( i1 i2 -- i )
        not 		( i -- i' )

	strlen		( s -- i )
	strcat 		( s1 s2 -- s )
	instr		( s1 s2 -- i )		finds string s2 within s1
	strcut		( s i -- s1 s2 )	cuts string at pos. i
	explode 	( s1 s2 -- ... i )      s2 is the partition, len >0
	subst 		( s1 s2 s3 -- s )	string, replacement, tobesub
	pronoun_sub	( d s -- s' )		does % subs a la osucc/ofail

	read 		( -- s )
	notify 		( d s -- )		player, message 
	notify_except 	( d1 d2 s -- ) 		place, player, message 
        pennies 	( d -- i )
	addpennies 	( d i -- ) 		player, pennies
        random 		( -- i )

	getpropval 	( d s -- i )		zero if none
	getpropstr 	( d s -- s )		"" if none
	addprop 	( d s1 s2 i -- )	ignores i unless s2 is ""
	remove_prop 	( d s -- )

	desc, name, succ,
        fail, drop, osucc,
        ofail, odrop:		( d -- s )	retrieve message

	setname, setdesc,
        setsucc, setfail,
        setdrop, setosucc,
        setofail:        	( d s -- )	set message

        player?, thing?,
        room?, program?,
	exit?, ok?:		( d -- i )	boolean

	location 		( d -- d' )
	owner			( d -- d' )
        moveto          	( d1 d2 -- )	moves d1 to d2
	set 			( d s -- )	object, string (flag)
	flag?			( d s -- i )	object, string, boolean
	call 			( d -- ??? )	call remote program
	match 			( s -- d )	thing, dbref (#-1 = NOTHING,
						#-2 = AMBIGUOUS, #-3 = HOME)
	rmatch			( d s -- d )	object, thing, dbref           
        copyobj 		( d -- d' )	returns dbref of new object
	contents 		( d -- ... i )	returns stack of dbrefs and i