Draft:Rat of choice

From Esolanging
Jump to navigationJump to search
This page is a stub and needs more information. Help us by adding more information.

Rat of choice is an esolang made by 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. "!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~