Putlines

From Esolang
Jump to navigation Jump to search

Putlines is a esolang that uses line selectors like "Run lines N to N" to loop

Commands

Normal

Print

print "hi"
print "this is how"
print "to do this"

Comments

#this counts as a line btw
#ok

Labels

loop:
print "this is used later"

Vars

a = 10
print a
b = a*a
print b

Unnormal

Run lines N to N

a = 10 #this is line 1
a = a*a #this is line 2
print a #this is line 3
Runlines 2 to 4 #this is line 4

Swap lines N and N

Swaplines 2 and 5
print a
a = a+1 #run second, caused by Swap line
a = 10 #run first, caused by Swap line
Swaplines 4 and 3

Set line N to C

Setline 2 to { print "hello" }
#replaced with print "hello"

Multi-Lines in Single-Lines

print "hi"; print "hello" #hi then hello
not:
out = 1-a
endnot:
a = 1; Runlines not to endnot; output = out

Examples

Loop

#note 0/0=0
a = 5
loop:
print a
a = a - 1
Runlines loop+(1-(a/a)) to 4+a/a
print "Lift off!"

Not

input = 1
output = 1-input

And

a = 1
b = 1
out = a*b

Or

#Use And and Not
not:
out = 1-a
nnot:
and:
out = a*b
nand:
input1 = 1
input2 = 0
a = input1
Runlines not to nnot
not1 = out
a = input2
Runlines not to nnot
not2 = out
a = not1
b = not2
Runlines and to nand
last = out
a = last
Runlines not to nnot
output = out