BrickLang is an esoteric programming language based on print bricks.
Each brick is a cell in a 3d program space, in which threads exist and move.
Threads have a direction and position, an arg register, and an acc register.
They keep going through instruction bricks and can pass through empty space.
Instruction reference:
! Spawn a thread going ^ when clicked or when the spawnThread event is triggered
X Terminate thread
^ Redirect thread in this direction
U Redirect thread up
D Redirect thread down
Y Split thread into two identical threads going left and right
T Randomly go either left or right
C Set arg = 0
. Set acc = arg, arg = 0
+-*/% acc = acc ? arg, arg = 0
0-9 arg = arg*10 + ?
N arg = -arg
S Swap arg and acc
> Compare acc to arg. If acc > arg go up, if = go right, if < go down
O Trigger onRelay events when a thread hits this brick
M If thread is going up or down, save acc to the M brick. If going left or right, set arg to the brick's saved value.