Timesplitter
Timesplitter is a esolang that has mutiple timeline which is unaviodable.
Overview
The code consists of some unordered notes. Here is the structure of each notes:
<condition 0> <condition 1> ... <action>
When more than 1 condition are met, random one will be choiced.
The memory stores by me
s.
me
Every me
has a clock
that stores a integer and increase it every step, and a integer register
that write-only to myself and read-only to other me
s.
When the program start, it will create a me
who has clock0
and register0
(or 0:0, clock:register), that me
's time will go forward. Which means that me
will create another me 1:0
on the timeline, the time will go on 1:0
too. For example:
0:0 > 1:0 > 2:0 > 3:0 ...
(>
shows the direction of time.)
Cross-timeline note
When a me do split
. While time going, the me will also split another me that goes backward. For example:
Code:
When 2 set 3 When 3 split
World:
0:0 > 1:0 > 2:3 > 3:3 > 4:3 > 5:3 5:3 < 4:3 < 3:3 <┘
And we can get me's register now.
Code:
When 2 set 3 When 3 split When 4 set reg me{1}
World:
0:0 > 1:0 > 2:3 > 3:3 >4:NaN>5:NaN 5:0 < 4:0 < 3:3 <┘
When 4 set reg me{1}
means if the clock is 4, then set my register to the register which is a me that has clock 1. That's why we got a me 4:0
(there's a 1:0
) and a me 4:NaN
(there's no 1:x
)
All the keywords
Keyword | Description |
---|---|
when <int>
|
This condition met when someone's clock coincident with the param |
see <selector>
|
This condition met when there's at least 1 object coincident with the selector |
see <me_selector> have <expression>
|
This special case will detect the register value of matched me, when there's more than one matched, it will OR the results up. |
set <expression>
|
This action will set the register to the expression |
split
|
This action will split another timeline which goes opposite |
suicide
|
This action will make the me suicide, and his/her timeline will shutdown |
reclock <expression>
|
This action will set the clock to the expression |
add <a>
|
Return a+b |
sub <a>
|
Return a-b |
mul <a>
|
Return a*b |
div <a>
|
Return a/b (the anwser is floored) |
input
|
This action will change the register value to the input immediately |
nxtIN
|
This action will move the input pointer for one char, the movement depends in logic order |
output
|
This action will output the register of the executor in global time order |