NullScript 1
Jump to navigation
Jump to search
NullScript 1 is an esoteric programming language invented by User:A. It is a subset of NullScript 2 and inspired by NullScript 2.
Commands
These are NullScript 1's 8 commands:
tcell group | |
---|---|
, |
Print the current cell as a character |
meta group | |
< |
Move the cell pointer left. |
> |
Move the cell pointer right. |
* |
Push the current cell to the parameter queue |
' |
Take the value from the parameter queue and put it into the current cell |
math group | |
+ |
Add two numbers from the parameter queue and put it into the current cell |
jump group | |
{ |
If the current cell is 0, jump to the next } . If there is none, jump to the end of the program.
|
} |
Jump to the previous { . If there is none, jump to the start of the program.
|
Implementation notes
- When a
,
is executed on a cell outside of the range of 0 to 127, it is undefined behavior. - When
<
would push the cell pointer below zero, the cell pointer wraps around to cell 255. Likewise, if>
would push the cell pointer above 255, the cell pointer wraps around to zero. - When the parameter queue is empty and a command requires a value from the queue, the value is received from input.
- If there is division by zero, the behavior is undefined.
Examples
Cat program
The following numeric cat program repeats until the user inputs a value of zero:
',{',}
Interpreter
- Common Lisp implementation of the NullScript 1 programming language.