AnnoyStack

From Esolang
Jump to navigation Jump to search

AnnoyStack is a stack-based language that is purposely created to be difficult to use. It also has an infinite tape, where each cell is of type char.

Instructions

All programs must begin with one of:

repeat X - where X is a number of times for the program to loop

forever - loop the program forever


and end with:

end - ends program loop


Loops cannot be used more than once and are required, as the program must be within the loop.


It has the following instructions:

lft - move the tape left, if lft is inputted at cell 0, stay at cell 0.

radd - move the tape right and add 1 to the cell

push - push value in current cell to stack

pop - pop value from stack to current cell

inp - input keypress to current cell

outp - output character from current cell

Example

Cat Program:

forever
inp
outp
end

Computational Class

As AnnoyStack can only halt after a fixed number of steps or not at all, it is less powerful than combinational logic. One could imagine a finitely bound combinational logic system, however even so, the available commands cannot create AND, OR, or NOT. Further, even if one could make at least AND/OR and NOT, one could not perform conditional no-ops to fill the remaining loops.

AnnoyStack is not total, as some programs can loop indefinitely.