Super Stack!

Super Stack! is a stack-based esoteric programming language by User:Orange.

How programs are run
Programs consist of keywords separated by spaces, tabs, and/or newlines. There is only one stack the program can manipulate.

Hello, World!
0 33 100 108 114 111 87 32 44 111 108 108 101 72 if outputascii fi First, push ASCII codes onto the stack for "Hello, World!" Then while there are nonzero numbers on the stack output them.

Cat program
1 if    0 inputascii if outputascii fi `output-stack pop 10 outputascii fi

Explanation: As you can see keywords can be separated by spaces or newlines.
 * 1 is pushed and then a while loop is entered. The 1 makes the loop run forever.
 * 0 is pushed so we can tell when input ends.
 * Input is pushed onto the stack.
 * While the top number is not 0, pop and output number.
 * Pop the 0.
 * Push 10 and output it(new line).
 * The stack now only has the number 1 on it, so the program will loop again.

Fibonacci sequence
0 1 if    dup output dup cycle add fi


 * Push 0 and 1 on the stack to start the fib.
 * If for an infinite loop.
 * Output the top of stack.
 * Dup top number then put it on the back of the stack.
 * Add the top two.
 * Loop. Top of the stack will always be more than 0.

Guess the pass code
0 58 101 100 111 67 32 115 115 97 80 32 114 101 116 110 69 if outputascii fi pop inputascii `compare each letter 109 sub not if pop 97 sub not if pop 114 sub not if pop 115 sub not if pop 104 sub not if pop 0 	100 101 116 110 97 114 71 32 	115 115 101 99 99 65 	if outputascii fi pop quit fi fi fi fi fi `wrong 0 71 78 79 82 87 if outputascii fi pop

A little game. Guess what the password is.

FizzBuzz
The stupid fizzbuzz problem. -100 if    dup 101 add dup output dup 3 mod not if        pop 0 122 122 105 102 `fizz if outputascii fi pop 0    fi pop dup 5 mod not if        pop 0 122 122 117 98 `buzz if outputascii fi pop 0    fi pop 10 outputascii `newline pop 1 add fi inputascii

Simple chat bot
1 if pop 0 58 116 117 112 110 105   if outputascii fi pop inputascii 0 5 random if pop cycle if cycle fi   0 fi pop 0 58 116 117 112 116 117 111   if outputascii fi pop cycle if dup outputascii cycle fi   10 outputascii 1 fi

First the program gets a string inputted onto the stack. Strings are represented by a 0 and then a series of characters that lead up to the next string. After the input, we randomly cycle from string to string. Then, we output the string and loop the program.

Implementations

 * v2 of the Python implementation
 * Super Stack!/superstack.ml, an implementation in Ocaml that almost matches the specs

Computational Class
Super Stack! is Turing-complete. Its only data structure is actually more "powerful" than a simple stack, due to commands instructions like  and. It is easy to transpose any given brainfuck into an equivalent Super Stack! program, for instance using the following algorithm: Note that this conversion is far from being efficient; its only purpose is to prove that Super Stack! is brainfuck-equivalent. It emulates an infinite tape, navigating with  and , pushing an extra 0 every time -1 is on top. It is assumed that the tape is right- and left-infinite and that brainfuck cells contain numbers between 0 and 255, with wrapping for  and. It is also assumed that  reads one character only, which may be slightly inconsistent with the specifications above.
 * Begin the program with the code.
 * Replace every brainfuck instruction by the matching Super Stack! instruction sequence in the conversion table below: