LoopScript
Jump to navigation
Jump to search
LoopScript (LS) is a simple esolang that only really uses loops that feed into each other (note: all variables start at zero)
commands:
+n add 1 to variable n -n subtract 1 from variable n %n set variable n to user input $n output based on value of variable n (by default just the value of variable n) (...)n while(n not equal to 0) loop
optional:
?n set variable n to random integer in set {1,2,...,n}
Programs
Cat program
+0(%1$1)0
Truth Machine
%1$1($1)1
Fibonacci sequence
%1+2((+4-2)2(+2+4-3)3(+3-4)4-1)1$3
n mod 2
%1(+3(-2-3)2(+2-3)3-1)1$2
floor(n/2)
%1+2(+3(-2-3)2(+0+2-3)3-1)1$0
2^n
%1+2((+3-2)2(+2-3)3-1)1$2
not a
%1+0(-0-1)1$0
a or b
%1%2(+3-1)1(+3-2)2(+0(-3)3)3$0
a and b
%1%2((+0-2)2-1)1$0