Dotlang

From Esolang
Jump to: navigation, search
The title of this article may well be dotlang, due to typically being lowercased except, often, at the start of a sentence.

Dotlang is a two-dimensional esoteric programming language created by User:Andrew3335. It was inspired by AsciiDots, hence its name "dotlang".

Language overview

Concept

You must start with one initial instruction pointer (the initial "dot"), which you must specify the position of by putting a (bullet point) at that position. You can also determine its initial direction by putting either ^ for up, v for down, < for left or > for right in the cell to the left of it. If not specified, the initial direction is right by default. Then, you can add as many as you wish by using the commands ( and ) (more on parentheses in the next section).

You can move dots up, down, left and right by using the commands ^, v, < and > (the same commands that are used for determining the initial dot's initial direction). If a dot moves onto a blank space, it stops existing, unless you only type a space and literally nothing else.

Dots can have values. A dot's value can be set and output by using ~ and # respectively (again, more on this in the next section).

Warps can teleport dots. The command for a warp is W (and yep, you guessed it, more on this in the next section).

Commands

and ^v<> have already been explained.

#number sets a dot's value to a number number, e.g. #32.0 sets a dot's value to 32.0 (this can either be an int or a float).

#`string` sets a dot's value to a string string, e.g. #`Hello World!` sets a dot's value to "Hello World!".

~ sets a dot's value to {whatever the user inputs}.

# outputs a dot's value. If the dot in question has no value, the program will halt.

Parentheses (parens) can have names. For example, (`seven is an open paren named seven. Open parens create another dot at its matching closing paren, i.e. a closing paren with the same name as the open paren. For example, if a dot moves to (`seven, another dot will be created at )`seven. If no such closing paren exists, the program will halt. Parens don't have a default name; if you don't specify a name, they just don't have one.

Warps have a starting point (`s) and an exit point (`e). Dots are teleported from the starting point to the exit point. Like parens, warps can have names. For example, Wseven`s is the starting point of a warp named seven. The starting point of a warp teleports a dot to its matching exit point, i.e. an exit point with the same name as the starting point. For example, if a dot moves to Wseven`s, it will be teleported to Wseven`e. If no such exit point exists, the program will halt. Warps don't have a default name; if you don't specify a name, they just don't have one.

W~ teleports a dot to the starting point of a warp named {whatever the user inputs}, meaning that an exit point is optional when using W~. For example, if the user inputs seven, the dot will move to Wseven`s. If no such starting point exists, the program will halt.

Control Flow Commands

Note: The corresponding vertical direction for right is up, for left it's down. The corresponding horizontal direction for up is right, for down it's left.

Command Description
! Checks if a dot's value is a string; if not, the dot continues in the same direction; if yes, the dot is ejected in its corresponding vertical/horizontal direction
? Does the same for floats
: Does the same for ints

Examples

Quine

This is the only time that the number of initial dots does not have to be 1. Fun fact: The creator likes Turing-complete languages, so he added this feature just to make a quine possible.

 

It's just a space, if you were wondering.

Cat program

•>~#v
 ^<<<

Explanation: First, the dot's value is set to {whatever the user inputs} and is then output. This is done infinitely.

Truth-machine

•W~

W0`s#0#
W1`s#1>#v
      ^<<

Explanation: First, the dot is teleported to W{whatever the user inputs}`s. If the user inputs 0, the dot ends up at W0`s, where its value is set to 0 and is then output. If the user inputs 1, the dot ends up at W1`s, where its value is set to 1 and is then output infinitely. If the user inputs anything else, the program halts.

Computational class

The creator believes that dotlang is Turing-complete, although it has not been proven yet.

Implementations

There are currently no implementations for dotlang, however the creator would like an implementation.

See Also