Talk:Woefully

From Esolang
Jump to navigation Jump to search

Can you give some clarification on what the language does when the IP comes to the end/beginning of a line, as well as stating whether the program starts in text or decimal I/O mode? Enoua5 (talk) 14:44, 4 June 2017 (UTC)

Turing-completeness?

I have something, but would like another set of eyes to see I haven't missed anything.

The two stacks and push/pop operations can simulate a tape. Each vertical trail of spaces can be thought of as a separate state (q,g) with g being the symbol the IP is on. `X move nops` can switch to another state (X meaning push a number, padding the remaining vertical space with nops (since it appears only then the move would trigger)). Since `move` moves horizontally, and pushing `X` requires spaces to go diagonally-down-left, ie. taking up horizontal space, `mult` can be it possible. At the start of the program the ends of the tape can be marked with -1, to facilitate popping from an empty stack for the IP to move left/right. More details are listed below.

Q=states, A=left stack, B=right stack, g=current tape symbol
state = (q,g)

start by changing the initial 0s to -1s on both stacks to mark the ends
1 AtoB diff diff dupe

push X to A
X

push X to B
X AtoB

BtoA
1 mult

move left
g AtoB # push g to B
# now pop A
dupe 1 mult # dup TOS of A
0 1 AtoB diff # -1
AtoB diff bool # TOS == -1
AtoB X diff move nops
#if was -1
X move # move to (Q_X,0)
#else
AtoB X diff move # move to (Q_X,A_0)

move right
g # push g to A
# now pop B
BtoA dupe AtoB # dup TOS of B
0 1 AtoB diff # -1
diff bool # TOS == -1
AtoB X diff move nops
#if was -1
X move # move to (Q_X,0)
#else
X diff move # move to (Q_X,B_0)

Kritixilithos (talk) 08:44, 28 September 2019 (UTC)