NOO!
NOO! is an Eek! derivative created by User:Zero player rodent that only uses the characters "N" and "O".
Commands
Command | Outcome |
---|---|
N | Moves the pointer to the right once. |
O | Increments the cell that the pointer is on by 1. |
Explanation
In NOO!, the command "N" will move a pointer on an array of cells to the right once. The command "O" will increment the cell that the pointer is on. The language will then interpret the numbers in the array as instructions that it executes. It will start on cell 0, and move to the right before interpreting any commands. Any character in a NOO! program that is not "N" or "O" will be treated as a comment. The language uses two stacks for memory, which will be referred to as "stack A" and "stack B". Below is the list of numbers that the language will interpret as instructions.
Numbers
Number | Instruction |
---|---|
0 | Increment the accumulator. |
1 | Increment the value at the top of stack A by 1. |
2 | Increment the value at the top of stack A by 10. |
3 | Print the ASCII character associated with the value at the top of stack A. |
4 | Set the value at the top of stack A to the ASCII value of one byte of input. |
5 | Move the pointer on the array that holds the instructions backwards a number of cells equal to the value in the accumulator. |
6 | Push 0 onto stack A. |
7 | Pop the value off the top of stack A a random amount of times, the highest possible amount of times is equal to the value in the accumulator minus 1. |
8 | Move the pointer on the array that holds the instructions forwards a number of cells equal to the value in the accumulator. |
9 | Pop the value off the top of stack A. |
10 | Move the pointer on the instruction array to the right 2 times if the value at the top of stack A is equal to the value in the accumulator. |
11 | Move the pointer on the instruction array to the right 2 times if the value at the top of stack A is not equal to the value in the accumulator. |
12 | Decrement the accumulator |
13 | Set the value in the accumulator to 0. |
14 | Set the value in the accumulator to the value at the top of stack A. |
15 | Push the value in the accumulator to the top of stack A. |
16 | Print the value stored at the top of stack A. |
17 | Push the value in stack A to stack B. |
18 | Push the value in stack B to stack A. |
19 | Pop the value off the top of stack B. |
20 | Decrement the value at the top of stack A by 1. |
21 | Terminate the program. |
Note that the instruction pointer usually moves forward one cell before interpreting a number as an instruction. An exception to this is when you use the commands associated with the numbers 10 and 11. If the instruction pointer moves forward two cells after the command is interpreted, it will interpret the command it is on without moving forward again (although if the command is a 10 or 11, the instruction pointer will move forward without interpreting it.). Another thing to keep in mind is that when the command associated with the number 5 causes the instruction pointer to move backwards, the language will move forward one cell before interpreting an instruction if the instruction's number is lower than 5.
Computational class
NOO! is Turing complete because it can simulate a version of brainfuck with unbounded cells. The +-.,
commands have a direct counterpart in NOO!, and with 2 stacks, a tape of memory can be simulated as well as the ><
brainfuck commands. NOO! is also capable of arbitrary conditional trampolines, which can simulate the []
commands.
Example programs
Program that counts up from 0 infinitely.
NOOOOOOOOOOOOO! NOOOOOOOOOOOOOOOO! NO! NOOOOOO! NOO! NOOO! NOOOOOOOOO! NNNNNNNNOOOOO!
Reverse cat (expects newline after input)
NOOOOOOOOOOOOO! NOOOOOO! NOOOO! NNNNNNNNNNNOOOOOOOOOO! NOOOOO! NOOOOOOOOOOOOO! NOOOOOOOOOOO! NOOOOOOOOOOOOOOOOOOOOO! NNNNNNOOO! NOOOOOOOOO! NOOOOO! NOOOOOOOOOOOOOOOOOOOOO!