Hinting tutorial/Stack manipulation
Here are some functions you can use to manipulate the stack. You won't need these functions often (some of them are barely used), but you should know that they are available.
If you are new to hinting, you can skip this part for now.
(CLEAR the stack)
- Pops all items from the stack
- The stack will be empty after this
(DUPlicate the top stack element)
- Pushes the stack top element again
PUSHB_2 1 2 DUP
After this, the stack will have three items: 1, 2 and 2.
(SWAP the top two elements on the stack)
- The top element becomes second element from the top
- The second element from the top becomes the top
PUSHB_2 1 2 SWAP
After this, the stack will have 1 on top.