Goto

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

The Goto programming language is an esoteric language by User:Rdococ in which there are only goto statements, and goto statements can have multiple line numbers, which then the user specifies which one to go to.

Structure

Every instruction is of the form:

GOTO 1 3 5 ...

If the GOTO statement has multiple arguments, the user is asked to input a number from 1 to the total number of statements and the program jumps to the corresponding argument. If the program jumps to a non-positive line, the negation of that number is printed to output and the program terminates immediately.

Computational Class

GOTO statements are states and its arguments are the transitions. Goto programs are therefore finite state automata.

Goto programs are able to recognize regular expressions. Map each symbol in the alphabet to a consecutive integer and non-positive line numbers to output states, then write down each state and its transitions to other states.

Examples

Truth-machine

If you input 1, then the program halts. If you input 2, the program will never halt.

GOTO 0 2
GOTO 2

Implementations