Stactal

From Esolang
Jump to navigation Jump to search

Stactal is an esolang created by User:Ϫ for the sole purpose of hurting your brain.

Fundamentals

Stactal is a stack-based esolang where stacks can go on other stacks. To create a new stack, you input this:

+1

This creates a new stack and assigns it the name 1. Stack names can only be numbers. To add a value to a stack, you type one of these:

"Hello World!":1   for strings
#12#:1             for pure numerical values
2:1                for other stacks
I:1                for user input

Then, to output a stack, you use this command, which outputs the stack's full contents, starting with the top. This does not alter the stack itself.

1 ->

If a stack is encountered during this command, it is instantly expanded into its contents. Stacks cannot be placed into other stacks if it would cause an impossible setup (1 containing 2, 2 containing 1).
The transfer command pops an item from one stack and pushes it onto another.

1 > 2

The conditional statement takes a stack and skips the next command if the top two commands are not equal.

1?

Go-to statements are made using this format:

{1}  go-to
...
[1]  label

To halt a program, simply type a $.

Programs

Truth Machine

+1
I:1
#1#:1
1?
{1}
1 ->
$
[1]
1 ->
{1}