|Computational class||Turing complete|
|Influenced by||Befunge (loosely)|
Stackish was a venture into stack-based programming by ender_scythe in November, 2016.
In Stackish nearly every command alters the stack somehow.
Stackish has 28 commands.
Note: character numbers start at 0.
||Pushes this number to stack.|
||Pushes this number/these characters's values to stack.|
||Pop last two numbers, add and push result to stack.|
||Pop last two numbers, subtract |
||Pop last two numbers, if second to last (equal/not equal/greater/less) last do...|
||Pop last number and jump to that character number.|
||Jump to the character number <character number>. If the command is |
||Pop last number, if the stack is empty after pop, jump to the character number that was popped.|
||Generate random number and push that to the stack.|
||Pop last number from the "popped" stack and push to "main" stack (referred to as the stack).|
||Pop last number from the stack.|
||Pop last number and output (as integer).|
||Pop last number and output (as ASCII).|
||Get input and push to stack (if ASCII, push first character's value).|
||Get input and push to stack (as if it were |
||Pause until keypress.|
||Clear the screen.|
||Swap last number of the stack with the first.|
||Swap last two numbers of the stack.|
||Duplicate the last number of the stack and push to stack.|
If you are making a Stackish interpreter/compiler, keep these things in mind.
- When popping, push the pop into the opposite stack. So if I'm popping from the "main" stack I would push to the "popped" stack, but if I was popping from the "popped" stack, I would push to the "main" stack. This ensures that the
qcommand works properly.
- If possible; have
rgenerate a number from 0 to 2,147,483,647.
This prints Hello, World! to the screen.
This prints a random number after every pause.
This prints the next Fibonacci number after ever pause (1,2,3,5,8,13...)
- Original Interpreter (Dead link)