AFTL

From Esolang
Jump to navigation Jump to search

AFTL (short for Another Fucking Time Loop) is a stack based esoteric programming language designed by User:Vriskanon. It almost uniquely manipulates its own source code in order to create new code, which is also run.

Commands

When AFTL is first run, it will automatically destroy all characters which are not inherently commands themselves. Then, it will run from left to right until the end. It will repeat the code once (unless commanded otherwise) or until it performs "." (which will stop the code).

Whenever a command is run, the code will destroy that command in the source code after completing the command.

Since all whitespace is removed alongside all characters that aren't commands in the code, one can have as much whitespace as they like to make the code clearer.

Command Description
@ Restart the program from the beginning.
. Print the entire source code excluding the ".". Exit the program.
< Destroy the cell to the left.
> Destroy the cell to the right.
( Destroy the cell to the left and push its ascii value onto the stack.
) Destroy the cell to the right and push its ascii value onto the stack.
^ Take the ascii character of the top item of the stack and replace this command with it.
+ Add the top two items of the stack.
- Subtract the second from top item of the stack from the top item of the stack (top - second from top).
* Multiply the top two items of the stack.
/ Divide the top item of the stack by the second from top item of the stack (top / second from top)
, Take a single character input and push its ascii value into the stack.
" Duplicate the top item of the stack.
[ Loop beginning (not destroyed).
] Go to the corresponding loop beginning and destroy both that and this command.
~ Ignore the next cell entirely.

Sample programs

Hello, world! program

)@"/""+"*"+""*+^
"""+"""+""/+"***+^
"""++""**""/"+"+*"^^
""+""+""/+*""*+""/+^
~,
""+"*"*"+^
"""+"""""/+"""/"++****-^
"""++""/"""++"+"*+*^
""+"""/+"""+*""/+**^
""+""""/+""****^
""+"""+""/+"***^
""+"*"*"++^
.

Cat program

,^.

External resources