- Caesar/Commander - a subject that performs most oerations. He prints to the output, he controls the program flow and he decides when we end. But he is dumb, so he can only remember one information at one time
- Basket - essntially a stack with fancy name
- Army - a subject that essentially operates the stack. They can receive commands from Caesar, perform basic operations (like addition or shuffling the stack), can receive information from him and send him information.
- raise x - raise flags A-F
- yell - prints the content of Caesar's memory to the output
- listen - listens for user input, saves it to commander memory
- save - saves evenrything presented as argument to the Caesar's memory
- signal - pushes the value in Caesar's memory to the basket
- # - comment
- if x y - if the value in the Caesar's memory is equal to x, do y
- if! x y - same as if but actvates if x isn't equal to memory
- move - move to the beggining of the program
- stop - stops the program's execution
- A - put the value on top of the stack to the bottom
- B - same but from bottom to top
- C - add the first and last stack elements
- D - add the first and second stack elements together
- E - send the top stack value to Caesar
- F - send the bottom stack value to Caesar
- G - remove the top value from the stack
save hello
world; yell;
There are no codeblocks in this language, so
if 5 {yell; yell;} #invalid;
if 5 yell; yell; #invalid;
if 5 yell; if 5 yell; #valid;
Entered argument x cannot contain spaces, but memory can.
comments are regarded as regular commands, so they must end in semicolon.
#valid;
#invalid
#valid
Also, the code isnt interpreted in real time, instead it shows output after it's finished running.
The program allows up to 5000 iterations
The default value of memory is non
Hello world:
save Hello World;
yell;
cat:
listen;
yell;
truth-machine:
if non listen;
if 0 yell;
if! 0 yell;
if! 0 move;
addition of two numbers:
if non listen;
listen;
signal;
listen;
signal;
raise D;
yell;