PushDupAddSub

From Esolang
Jump to navigation Jump to search

PushDupAddSub (PDAS) is an esolang by User:ChuckEsoteric08 inspired by Volatile

Commands

1 - push 1
+ - pop a and b, push a+b
- - pop a and b, push b-a
/ - pop a and b, push b/a followed by remainder
: - duplicate
[...] - while 0 

Computational class

PDAS is Turing-conplete becaue PMMN-like language to it:

n should be prime number. P(n) would push n, when compiled to normal it uses 1, + and :

Initialisation:

1

inc(n):

: n-times, + n-times

dec(n):

P(n)/:-+

while(n):

:P(n)/[+ ... P(n)/]:-+

if(n):

:P(n)/[+ ... 11+]:-+