Story variables
memory (whole number) and journal (text). The only program-wide globals.
Two fixed globals. Same assign glue as dog fields (is, are, has, …). No other user-defined globals exist (except trick params and for each loop variables).
memory (whole number)
| Line | Parses as | Need to know |
|---|---|---|
memory is 4 | Assign[memory, 4] | Must be whole number in short range |
memory is count of the items in the cookie jar | Assign[memory, StashAccess(COUNT)] | Coerced to a number |
bark memory | Print + Variable(memory) |
journal (text)
| Line | Parses as | Need to know |
|---|---|---|
journal is "walk time" | Assign[journal, "walk time"] | Strings and field reads |
journal is her name | Assign[journal, Field(…)] | Any value that prints as text |
bark journal | Print + Variable(journal) | Starts empty |
Lines where memory or journal is the assignee parse as story-variable assignment.
Example from bimba.woof:
her cookie jar holds some items: "cookie", "cookie", "cookie", "cookie"
memory is count of the items in the cookie jar
Later: memory minus how many treats Bimba has in a print expression.
