Variables hold one value that can be pushed to the stack. To make a variable, you use
:. This will take the value on the top of the stack and set the variable's value to it.
C is now set to 4. This will override any numbers, so using C won’t push 12 anymore, it will push 4. You can use any Unicode characters, but they will add to you byte count.
To push the value of a variable, you just have to use it as an operator.
The stack now holds 8:
- 4 is pushed
- the value of k is set to 4
- 4 is popped off
- k is pushed twice, putting two 4s on the stack
- the two 4s are added together, leaving 8
To change the value of a variable, you just have to reassign it to the top of the stack using
The top of the stack is now
Q gets input as a Number if the input is a Number, or String if it is a String. It will also set the variable
Q to what you inputted, just like Pyth's
z gets input as a String. It will also set the variable
z to what you inputted, just like Pyth's
J will define a new variable called
J that has the value of the top of the stack, just like if you did
K will do the same.