DerpText

From Esolang
Jump to navigation Jump to search

DerpText, not to be confused with similarly named languages, is a language made by User:Fuckerturd. DERP.

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 are variables, a text string, and a command string. 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 initial and final values of the text string can be used for I/O.

Commands

Command Operation
=var1=text2= Sets the variable var1 to text2.
!var1! Loads the variable var1 into the command string at the beginning.
~var1~ Loads the variable var1 into the command string at the end.
^text1^ Places the text text1 into the text string at the beginning.
&text1& Places the text text1 into the text string at the end.
>text1>text2> Deletes all text2 before the first occurrence of text1 in the text string.
<text1<text2< Deletes all text2 after the first occurrence of text1 in the text string.
@var1@ Swaps the text string with the variable var1.
#var1# Swaps the command string with the variable var1.

Examples

&Hello&

Puts the text Hello into the text string.

=A!=B=

Sets the variable A! to the string B.

>/>12>

Text string 123123/123123 becomes 33/123123.

</<123<

Text string 123123/123123 becomes 123123/.

<<1<

Text string 123123/123123 becomes 2323/2323.

External resources