MOO Programmer's Quick Reference Sheet
Edit Page
Report
Scan day: 19 February 2014 UTC
-39
Virus safety - good
Description: A cheat sheet of the vocabulary used in MOOs. Cryptic for non-programmers.
MOO programming cheat sheet. Types NUM number 34 STR string "\"Hi\," said John." OBJ object #23 LIST list {34, "a string", {"a", "sublist", 3}, {}} ERR error E_TYPE Errors E_TYPE type mismatch E_DIV divide by zero E_RANGE invalid subscript E_INVARG invalid argument E_VARNF variable not found E_PROPNF property not found E_VERBNF verb not found E_PERM permissions error E_INVIND invalid object number E_MAXREC exceeded maximum recursion depth Subscripting Everything is 1-based. subscript lists or strings s[expr] is lvalue and rvalue s[expr..expr] does slices. Exprs must be in range. @expr does list splicing for lists or arguments. Special variables in functions this the object caller value of "this" in calling function, or player at top-level player player that invoked the task verb verb named used to invoke verb args list of arguments [For commands] argstr everything after first word of command dobjstr direct object string dobj direct object value prepstr preposition string iobjstr indirect object string iobj indirect object value Exprs Usual C stuff, except: cond ? expr1 | expr2 conditional expressions $foo #0.foo "str" + "str" concatenation expr in list list membership, returns index or 0 (false) Strings comparisons case-insensitive. Statements if (expr); ... elseif (expr); ... else; ... endif for variable in (expression); ... endfor for variable in [expr1..expr2]; ... endfor while (expr); ... endwhile fork (expr); ... endfork fork name (expr); ... endfork MATH min(n1, n2, ...) -- minimum of n1,n2,... max(n1, n2, ...) -- maximum of n1,n2,... abs(n) -- absolute value of n sqrt(n) -- square root of n, rounded down random(n) -- random integer between 1 and n inclusive $math_utils: -- Trigonometric/Exponential functions :sin(a),cos(a),tan(a) -- returns 10000*(the value of the corresponding trigonometric function) angle a is in degrees. :arctan([x,]y) -- returns arctan(y/x) in degrees in the range -179..180. x defaults to 10000. Quadrant is
Size: 2048 chars
Contact Information
Email: —
Phone&Fax: 2147483648
Address: —
Extended: —
WEBSITE Info
Page title: | |
Keywords: | |
Description: | |
IP-address: | 129.177.5.137 |
WHOIS Info
NS | Name Server Handle.........: ALF3H-NORID Name Server Handle.........: BEGO3H-NORID Name Server Handle.........: EIK2H-NORID Name Server Handle.........: NN14H-NORID |
WHOIS | |
Date | Created: 1999-11-15 Created: 2010-10-01 Last updated: 2013-11-16 Last updated: 2010-10-01 |