DerpScrp

From Esolang
Jump to navigation Jump to search

DerpScrp, not to be confused with similarly named languages, is an esoteric programming language invented by User:A that is created in 2019 influenced by the syntax of DerpText.

Syntax

Commands have one or more parts containing text, all separated by a command ending character. Variables can consist of zero or more characters, but not all are allowed by the syntax of every command. The varN or textN of a command cannot contain the command ending character because it ends the text.

Semantics

There is a console output string(A), a text string(B), and a command string(C). There is an infinite number of variables, all initially set to the empty string. The text string is set by the user before the program starts and can be empty. The command string is the program and commands are deleted from the beginning of the string as they are processed. The whole console output string will be outputted constantly, waiting 0.5sec and clearing the screen in every step.

Commands

Command Operation
&text& Appends text to the output console.
=string=string2= Exchanges string1 with string2. If string2 is a constant, then string1 will be set to that constant.
>string>constant> Remove all occurences of constant in the string string.
<string<constant< Keep all occurences of constant in the string string.
+text+ Append text to the program (text can be both strings or constants).

Examples

&Hello&

Outputs "Hello" to the console. (Appends Hello to A)

=A=B=

Exchanges B with the value that the pointer A is pointing to (i.e. the output console)

=A=123=

Change the output of the console to 123. (A constant cannot be swapped to represent A, so it is kept as-is.)

>A>12>

Remove all occurences of 12 in the output console.

<A<12<

Keep all occurences of 12 in the output console.

+A+

Append the contents of the output console to the program.