We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Teleporto

From Esolang
Jump to navigation Jump to search

Teleporto is an esolang where commands teleport to one anther.

Each line starts with a number (or an equation that becomes a number), when the line ends, they teleport to the line of that number (if the equation has changed due to a variable use the new value of the equation).

Commands:

Command Description
~(x) chose random number in set {1,2,...,x}
$(x) print x
#(x) variable x
@(x,y) change variable x to y
?(exp;code) run code if exp
` number is user's choice

math/Boolean commands:

Command Description
x+y x+y
x-y x-y
x*y x times y
x/y floor(x divided by y)
x%y x modulo y
x^y x^y
(exp1)&(exp2) exp1 and exp2
(exp1)|(exp2) exp1 or exp2
!(exp) not exp
x=y x=y
> x is greater than y
< y is greater than x

It is probably possible to make a compiler for this.

note: $(x) can be a multivariable function instead. For example you could use $(x,y,r,g,b) to indicate that the pixel located at (x,y) should be changed to rgb (r,g,b), you can also put strings in $() but not outside of it

Syntax

Code is all stuck together except for the exp. at the start which has a space separating it from the rest of the equation.

You could also use the number at the start to indicate a block of code (indented) to be processed as a line.

Line numbers start at 1, use a jump to line 0 to exit the program.

Numbers must be integers.

Variables start at 0.

Programs

Hello world:

0 $("Hello world")

Looping counter:

2 @(1,#(1)+1)@(3,#(1))
#(2) ?(#(3)=0;@(2,1)$("\n"))?(!(#(3)=0);@(2,2)@(3,#(3)-1)$("*"))

Or

2 @(1,#(1)+1)@(2,2)@(3,#(1))$("\n")
#(2) @(3,#(3)-1)$("*")?(#(3)=0;@(2,1))

Cat program:

1 $(`)

Truth machine:

2 @(1,`)@(2,0)?(#(1)=1;@(2,2))
#(2) $(#(1))

XKCD challenge:

0 $(4)

Kolakoski sequence:

1 @(4,1)@(2,1)
4 @(3,#(3)+1)@(#(3)+5,#(4))$(#(4))@(2,#(2)+1)
4 @(3,#(3)+2)@(#(3)+4,#(4))@(#(3)+5,#(4))$(#(4))$(#(4))@(2,#(2)+1)
#(1) @(1,#(#(2)+5)+1)@(4,3-#(4))

Programing methods

while loop:

a while can be made as follows:

#(1) @(1,1)?((condition);@(1,2))(code)

functions:

a function can be made as follows:

#(1) @(2,f(#(3),#(4),...,#(n)))

set #(1) to whatever line will be used next

set #(3),#(4),...,#(n) to whatever the inputs are

variable #(2) is the output