Remember is a simple interpreted esoteric programing language
Like the human short term memory this language can only remember a limited number (8) objects at any time and forgets all additional objects without warning.
- Write the code you want to run in a text-file.
- Run Main.main() The program should output:
Input a Filename:
- Supply the name of the file to run, use the prefix "." for files in the local directory
Look at demo.txt for a demonstartion of the basis synatx.
The program is organized in lines of operations and values separated by spaces.
the program is executed line by line. if the program is unable to execute a line, it simply starts executing the next line
##Memory: The program can remember values with arbitrary names of the form
[a-zA-Z][a-zA-Z_0-9]*
The "forgetting" process works in the following way
- when remembering a variable it is stored on top of the memory
- using a values brings it up to the top of the memory
- if the memory is full the lowest value in the memory is removed
remembers the given values and stores it under the given ID
REMEMBER [ID] [Value]
forgets the value associated with the given id
FORGET [ID]
Jumps to the given id
JUMP [ID]
jumps to the value of ID if Value is >,>=,!= 0
JGT [ID] [Value]
JGE [ID] [Value]
JNE [ID] [Value]
Prints the given Value
PRINT [Value]
##Values A value is either a 32-bit integer, a Memory id or an Operation on another value
Each element on the operation-stack takes one memory slot therefore long operation chains clear most of the memory
1 if value is 0, otherwise 0
NOT [Value]
negates the given value
NEG [Value]
NEGATE [Value]
bitwise and of the given values
AND [Value] [Value]
Adds the given values
ADD [Value] [Value]
The current line Number
LINE
Reads the next line, and converts it to an integer if possible
READ