Confusing
Jump to navigation
Jump to search
This is a very confusing programming language. The commands don't do what you think they do.
| Instruction | What it ACTUALLY does (not what you think it does) |
|---|---|
| 12'34 | The number literals do NOT make sense. 0 actually means 9, 1 means 8, and so on. And the decimal point isn't even a decimal point. So the above example pushes 87.65. |
| "..." | Pushes the ascii codes of everything inside, WITH BITWISE NOT APPLIED. So "a" actually pushes "\x9E". |
| - | Add top two elements. |
| + | Subtract. |
| / | Multiply. |
| * | Divide. |
| ^ | Modulo. |
| % | Power. |
| ) | Start codeblock. |
| ( | End codeblock. |
| W | If top of stack is zero, then [next codeblock]. |
| I | While top of stack is zero, do [next codeblock]. |
| n | Input character into stack. |
| C | Output top of stack as number. |
| c | Input number into stack. |
| N | Output top of stack as character. (MODULO 255 FIRST!) |
| $ | Duplicate top of stack. |
| ; | Pop top of stack. |
| \ | Dup the second stack item (over). |
| | | Swap top two stack items. |
| X, Y | Pop from main stack and push to the corresponding storage stack. (Finally something that makes sense.) |
| x, y | Pop from storage stack and push to main stack (WARNING: x actually pops from Y and vice versa) |
| ! | Negate top stack item. |
| _ | Logical not stop stack item. |
| < | Pop a and b, push 1 if a>b, and 0 otherwise. |
| > | <, but with less than. |
| . | Pushes ascii code of the next character (remember the decimal point?) |
| P | Get. Pop x, pushes ascii code of command x. Empty cells are equal to -1, not 0, so be VERY careful. |
| G | Put. Pop x and y, replace xth command with y. |
| E | If followed by a codeblock, defines a function for the next character. Else, calls that function. |
| F | End the program. |
| L | Clear the stack. |
| X | Push stack length. |
| U | Move bottom stack value up. |
| D | Move top stack value down. |