Stack Words

To get anything done in Smojo, you need to use its stack. There are a few built-in words you can use:
WordAction
DROP

Pops the top item off the stack and discards it. This item is lost and can't be retrieved.

DUP

Duplicates the top of the stack. For example,

1 DUP
ends up with
1 1
on the stack. Note that
DUP
does not re-create things on the stack; it merely duplicates pointers to things.

SWAP

Swaps the top two items on the stack. For example,

"Hello" "World" SWAP
ends up with
"World" "Hello"
on the stack.

Quiz

Question 1

Write a word called 
DOUBLE
that puts double the number on the top of the stack. For example,
23 double .
should display 46



Question 2

Write a word called 
1/
that puts reciprocal of the number on the top of the stack. For example,
5 1/ .
should display 0.2



Next: Locals