Boink

From Esolang
Jump to navigation Jump to search

Boink is a language with 1 command by User:Hammy.

Memory

Memory is stored on a tape of addresses which can be 0 or 1.

The command

x:y is explained in this pseudocode.

if address x is 0:
 jump to line y
 move the pointer left if the current cell isn't the first cell
otherwise:
 move the pointer right and flip the current bit

Special lines

0 is output. It will always be jumped to, no matter what x actually is. It adds the value of x to a bit stream. When the bit stream is 8 bits long, it gets converted to ASCII and outputted.

-1 is input. It will ask for input and store it in x.

-2 restarts the program.

-3 flips the bit.

Anything below terminates the program no matter what.

Jumping to the current line is a NOP.

Examples

Binary cat

Explained in ooooh!#Binary Cat

1:-1
1:0
1:-1
1:0
1:-1
1:0
1:-1
1:0
1:-1
1:0
1:-1
1:0
1:-1
1:0
1:-1
1:0
1:-4

Truth machine

One of the more advanced programs.

1:-1
1:14
1:0
1:0
1:-3
1:0
1:0
1:0
1:-3
1:0
1:-3
1:3
1:-4
1:0
1:0
1:-3
1:0
1:0
1:-3
1:0
1:0
1:0
1:0
1:-4