↑→↓
Jump to navigation
Jump to search
↑→↓ pronounced up to down(can be shortened to UTD as ill be writing it on this page) is a esolang invented by User:Yayimhere thats a abstract machine where you create states of 3 different simulated computers who can send their states to each other. each computer runs in order from computer 1 to computer 3.
overview
each computer has a label which is as follows:
label | computer |
---|---|
↑ | computer 1 |
→ | computer 2 |
↓ | computer 3 |
each computer can hold one value which can all be set to something else in a state. all commands that do not set a computers state needs to be in a state
syntax
the syntax of UTD
instruction | description | pseudocode |
---|---|---|
@A[B] |
set computer A's state to state B | A.state() = state.B() |
@A/[B][C]/[D][E] |
if computer A's state is B set its state to C and if its D set the state to E | if A.state() == state.B() do A.state() = state.C() elif A.state() == state.D() do A.state() = E.state() |
[A]: |
define state A as all the lines underneath this line until the last indented line in the block of indented lines | state.A = lines.below until last.type(indented) in(block.indented) |
@A-@B(+)=@C |
add the value in computer A's value and computer B's value and store it into computer C | C.val = B.val + A.val |
@A=#B |
set computer A's value to the value B | A.val = B |
@A[B]! |
loop B as long as computer A's value is non 0 | while A.val != 0 do B |
@A:- |
negate computer A's value | A.val = A.val * -1 |
; |
print all the computer values as ascii chars | print(chr(↑.val, →.val, ↓.val)) |
: |
print all the computer values as numbers | print(↑.val, →.val, ↓.val) |
,@A |
set computer A's value to user input(number) | A.val = input() |
@A[] |
represnts the state of computer A | A.state |
examples
[truth-machine]: ,@↑@↑[:]!: @↑[truth-machine]