stjck
Jump to navigation
Jump to search
- This is still a work in progress. It may be changed in the future.
stjck is an esolang created by user:cleverxia. There are no typos here. It has 2 stacks, a IP stack and a data stack
Program flow
every program in queje consist of some commands that does two things: change the IP, and does someting to a stack. Popping an empty stack gives a random number and it's the only way to get anything random. IP out of bounds wraps.
| command | meaning | what it does |
|---|---|---|
_ |
advance/APLWSI | IP+=1 |
@ |
halt | halt |
: |
dup | pop stack top(let it be x),push x twice, then let IP=x |
` |
push | push IP to data stack, then IP+=1 |
_ |
discard | set IP to stack top (pops) |
[ |
flag | push current IP to IP stack, then IP+=1 |
] |
branch | set IP to IP stack top (pops) |
? (wimpmode only) |
condition | set IP to IP stack top (pops) if data stack top!=0 (also pops) |
0~9 |
number | push the number (let it be X), then IP+=X (+1 if X==0) |
+ |
add | pop a, pop b, push a+b, and increase IP by it |
- |
sub | pop a, pop b, push b-a, and decrease IP by it |
* |
mul | pop a, pop b, push a*b, and multiply IP by it |
/ |
div | pop a, pop b, push b/a (integer divide, rounds to -inf, x/0=0), and divide IP by it |
% |
mod | pop a, pop b, push b%a (always positive, x%0=x), and modulo IP by it |
< |
output | pop a, output a as character, and set IP to it |
> |
input | input a character, push ASCII code to stack and set IP to it |
) |
rroll | roll the stack top to the bottom, and set IP to it |
> |
lroll | roll the stack bottom to the top, and set IP to it |
Examples
infinite loop
[]
truth machine
- This is still a work in progress. It may be changed in the future.