GTF

From Esolang
Jump to navigation Jump to search

GTF (go to function) is a variant of MIG where functions are used instead of lists.

a GTF program looks like this:

f_1(n) "string_1"
f_2(n) "string_2"
.
.
.
f_m(n) "string_m"

n is the number of times that the line has been landed on (increases upon arrival), f_i(n) is the function of n that outputs where to go next (can combine supported functions)(if the output is not a line, exit the program), and "string_i" is the string that will print on arrival (optional)

supported functions

x+y
x*y
x/y
x-y
x^y
x%y (x mod y)
-x (if you call it one)
e (constant)
π (constant)
γ (constant)
φ (constant)
x! (as Γ(x+1))
all integers 
ln(x)
sin(x)
cos(x)
tan(x)
sinh(x)
cosh(x)
tanh(x)
arcsin(x)
arccos(x)
arctan(x)
arcsinh(x)
arccosh(x)
arctanh(x)
ψ(x) (digamma (derivatives supported (')))
ζ(x)
d(x) (divisor function)
floor(x)
ceil(x)
round(x)
$ (user inputted number)
?(x) (random number between 0 and x (uniformdist))