distressed

From Esolang
Jump to navigation Jump to search

distressed is a Turing complete version of Stroke, that does not add any conditionals, wheels, or other tricks, but still has the same amount of commands. As such, distressed is arguably a better alternative to Stroke+-. It was created by User:Yayimhere, originally as a ramble on stroke's talk page

New commands

as distressed uses semi complex commands, ill give a section for each

Loop

A loop is made up of:

/ var1 index1
	...
\

This will reference the bit at index1 of var1, and loops as long as that index is non zero. However, do note that the given variable is only checked when the loop is initially entered, and afterwards, it will check on the last variable referenced in the loop

XOR

distressed uses a weird variation of an XOR to change bits. This is also how it gets its name, as all bits change, as if they were quite "distressed". The XOR takes the below format:

| var1

This performs the below sequence on var1:

XOR every bit with 1
Add a 0 to the end
Do a not on the next to last bit

Yes, this implied distressed uses bit strings for computation instead of single bits.

Variables

Variables are referenced by an index with the below format:

|*n

This references a variables of the cell space with index n-1. Cells are indexed by one. However, there is one change from stroke. Every time a variable is referenced twice, the second time it's referenced its index is plus one. Then for the third time it's plus two, ect., And every time another variable with lower index is referenced, it also has the value added. As such, there is an imaginary non existent pointer. Note that when this minus happens, it also applied to the original variable we are going from.

Syntax

Unlike stroke, distressed simply requires that every command is separated by the sequence _ (including the spaces)

Computational class

distressed is turing complete via translation from brainfuck minus -:

first, > and < must be used as inputs to operators, however they can then be used alike this:
> = ||
< = |
and then a plus must take the last variable referenced as input. If you do not want to change the cell, then use a |. as such we can say:
>+ = | || _ | ||
<+ = | | _ | |
>x<+ = | | _ | | where x is any non + command that also references a variable
and for loops, thats pretty easy:
>[...] -> \ || | _ ... \
<[...] -> \ | | _ ... \
>x<[...] -> \ | | _ ... \

Do note that all formatting in distressed applies to this translation.