We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Rat of choice
Jump to navigation
Jump to search
Rat of choice is an esolang made by User:Assembly with some commands.
Description
Rat of choice has a stack that goes infinitely in both ways.
By default, areas that haven't been accessed yet are uninitialized. You only initialize an area of the stack if you enter it.
Commands
| Command | Description | Example usage |
|---|---|---|
| ^ | Moves up in the stack. | +^++,v, |
| v | Moves down in the stack. | +^++,v, |
| + | Increments the number in the area. | +^++,v, |
| - | Decrements the number in the area. | 8--. |
| 0-9 | Pushes that number to the area. If there's already a non-zero number in the area, append the number to the left. | 8--. |
| , | Prints the value in the area without popping it. | +^++,v, |
| . | Prints the value in the area and pop it. | 8--. |
| " " | Pushes each character into the area, appending new characters to the left of the string in the area. If it appends a newline, it appends to the top line instead of to the bottom | "!dlroW ,olleH". |
| ← | Jumps to the Nth symbol (N is determined by the number at the top of the stack). If N is 0, continue normally. | 1,← |
| : | Assigns a value to a variable which name is determined as the next symbol. | "!iH":a~ |
| $ | When placed inside a string, is equivalent to the string itself with quotes, including the $. | "$". |
| ~ | Returns and pops the most recent variable. | "!iH":a~ |
| ℕ | Asks for input as a number. | |
| * | Multiplies the topmost value of the stack by the second topmost value of the stack and saves the value on the topmost value of the stack. | |
| → | Skips the next N symbols. (N is determined by the topmost value of the stack.) | |
| ; | Assigns a value to a variable which name is determined as the next symbol, but doesn't pop the assigned value from the stack. |
Calling a variable changes the pointer to the variable.
Examples
Hello, World!
"!dlroW ,olleH".
Truth-machine
ℕ^11:a*^3→^1.a←0.
Quine
"~a:$":a~