Free Hero Mesh

Changes To Program instructions
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Changes to "Program instructions" between 2018-04-07 20:10:27 and 2018-04-07 20:34:11

1
2
3
4
5
6
7

8
9
10






11

12
13





































14
15


16


17




































1
2
3
4
5
6

7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56


57
58
59
60
61

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97






-
+



+
+
+
+
+
+
-
+


+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+

+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(Note: This may change as the program is being written and it is currently a draft.)

In some places in a <tt>.class</tt> file, program instructions can be used. This includes in any global message block, class message block, <tt>SUBS</tt> block, <tt>Goal</tt> block, or global function definition.

The heading includes the instruction name (if in parentheses, it takes other stuff inside of the same block with parentheses; there may be brackets afterward if some other name or number is a part of it), followed by the stack effect (given in a notation like Forth).

Some headings include <b>,</b> and/or <b>=</b> after the stack diagram if it supports those prefixes optionally. In this case, <b>,</b> means a variable of another object (taken on the stack below the value, if writing), while <b>=</b> means to write instead of read (the value to write is taken below another argument if any, but above the object if any).
Some headings include <b>,</b> and/or <b>=</b> after the stack diagram if it supports those prefixes optionally. In this case, <b>,</b> means a variable of another object (taken on the stack below the value, if writing), while <b>=</b> means to write instead of read (the value to write is taken below another argument if any, but above the object if any). If the heading says <b>,c</b> then you can also read the value from a class (it is read-only in this case; the syntax does not change).

You can also use numbers as instructions (that push their value to the stack), either in decimal or in hexadecimal (with <tt>0x</tt> at first), and an optional minus sign is allowed at first for negative decimal numbers.

<h2 id=xd0>$[] ( -- class )</h2>
Push a class name to the stack. The class must be defined, although it does not necessarily have to be defined above where it is mentioned.

<h2 id=xh0>#[] ( -- message )</h2>
Push a message name to the stack. The message does not have to be declared anywhere. If there are no message handlers, sending this message to any object will just result in zero.

<h2 name=xp0>%[] ( -- value ) =</h2>
<h2 id=xp0>%[] ( -- value ) =</h2>
Read a user variable of this object. All user variables are initialized to zero and can store any value. You do not need to declare them first.

<h2 id=string>"[]" ( -- string )</h2>
Push a string to the stack. The string can include escape codes:
  *  <tt>\\</tt> - Represents a literal backslash.
  *  <tt>\"</tt> - Represents a literal quotation mark.
  *  <tt>\0</tt> - Set text colour to black.
  *  <tt>\1</tt> - Set text colour to blue.
  *  <tt>\2</tt> - Set text colour to green.
  *  <tt>\3</tt> - Set text colour to cyan.
  *  <tt>\4</tt> - Set text colour to red.
  *  <tt>\5</tt> - Set text colour to purple.
  *  <tt>\6</tt> - Set text colour to yellow.
  *  <tt>\7</tt> - Set text colour to white.
  *  <tt>\b</tt> - Draw a horizontal line.
  *  <tt>\c</tt> - Centre alignment.
  *  <tt>\i</tt> - Follow by a class name (without <tt>$</tt> at front), a colon, a image number, and then another backslash. Draws that picture.
  *  <tt>\l</tt> - Left alignment.
  *  <tt>\n</tt> - Line break.
  *  <tt>\q</tt> - Quiz button; follow by a single character specifying what key code is emitted when it is clicked (you can also push the keys directly, even if there is no corresponding quiz button). If this escape code is present, then a KEY message is sent to the object that displayed this string.
  *  <tt>\x</tt> - Follow by two hex digits to represent that character code.

The string can also include directives:
  *  <tt>%%</tt> - Represents a literal percentage sign.
  *  <tt>%c</tt> - A single character (by 8-bit character code)
  *  <tt>%d</tt> - Signed decimal number
  *  <tt>%i</tt> - A picture (given a class and image number)
  *  <tt>%n</tt> - A representation of the value (a class, message, or object)
  *  <tt>%u</tt> - Unsigned decimal number
  *  <tt>%x</tt> - Hexadecimal number

The directives can optionally have a minimum field width and/or a "<tt>0</tt>" flag.

<h2 id=xxArg1>Arg1 ( -- v ) ,=</h2>

<h2 id=xxArg2>Arg2 ( -- v ) ,=</h2>

<h2 id=xxArg3>Arg3 ( -- v ) ,=</h2>

<h2 name=xxbit0>bit[] ( -- n )</h2>
A constant with exactly one bit set; replace [] with a number 0 to 31.
<h2 id=xxbit0>bit[] ( -- n )</h2>
A constant with exactly one bit set; replace &#91;] with a number 0 to 31.

<h2 id=xxbnot>bnot ( in -- out )</h2>

<h2 name=yxbit>(bit) ( -- n)</h2>
<h2 id=yxbit>(bit) ( -- n )</h2>
Includes a list of numbers in range 0 to 31, and the result is the number with those bits set.

<h2 id=xxClass>Class ( -- class ) ,</h2>

<h2 id=xxDestroyed>Destroyed ( -- b ) ,</h2>

<h2 id=xxFrom>From ( -- obj ) ,=</h2>

<h2 id=xxIsPlayer>IsPlayer ( -- b ) ,c</h2>

<h2 id=xxlnot>lnot ( in -- out )</h2>

<h2 id=xxMisc1>Misc1 ( -- v ) ,=</h2>

<h2 id=xxMisc2>Misc1 ( -- v ) ,=</h2>

<h2 id=xxMisc3>Misc1 ( -- v ) ,=</h2>

<h2 id=xxMisc4>Misc1 ( -- v ) ,c=</h2>

<h2 id=xxMisc5>Misc1 ( -- v ) ,c=</h2>

<h2 id=xxMisc6>Misc1 ( -- v ) ,c=</h2>

<h2 id=xxMisc7>Misc1 ( -- v ) ,c=</h2>

<h2 id=xxMsg>Msg ( -- msg ) ,</h2>

<h2 id=xxneg>neg ( in -- out )</h2>

<h2 id=xxShape>Shape ( -- n ) ,c=</h2>

<h2 id=xxShapeDir>ShapeDir ( dir -- n ) ,c=</h2>

<h2 id=xxTemperature>Temperature ( -- v ) ,c=</h2>