User:Taneb/Binary Variety Pack

From Esolang
Jump to navigation Jump to search

Binary Variety Pack is a hodge-podge of various binary languages. Which is executed depends on the first 2 bits (which are otherwise ignored).

Data is inputted before execution, and the entire tape is spewed on halting.

Variations

00: Bitwise Cyclic Tag

The program is executed as Bitwise Cyclic Tag would be, with the data string displayed somehow at every tick:

CommandOperation
0Deletes the leftmost databit
1Goes to the next command (say x). If the leftmost databit is 1, x is copied on to the right end of the datastring

01: brainfuck-esque (gasp! blasphemy!)

Everyone probably now knows how brainfuck works, here're the commands for this version.

CommandOperation
00Moves the pointer left, and flips the bit at the pointer
01Moves the pointer right
10Jumps past the matching 11 if the bit at the pointer is 0
11Jumps back to the matching 10 if the bit at the pointer is 1

The tape is outputted on every 00 command.

10: Binary combinatory logic

A term in Binary combinatory logic is of the format:

00 | 01 | 1 <term> <term>

The rules for subterms of a given term is (parsing from right to left):

1100xy   --> x
11101xyz --> 11xz1yz

The terms 00 and 01 correspond, respectively, to the K and S basis combinators of CL, and the "prefix 1" acts as a left parenthesis (which is sufficient for disambiguation in a CL expression).

The term is evaluated with the inputs λn.n+1 and 0, as in Church numerals. The result is then outputted, assuming no errors occur.

11: Cellular automatons

The program is a Wolfram Code with two states, one dimension, and the smallest possible neighbourhood size. This is then run with the input data as the initial state. The field is outputted every generation, and it runs until the user stops it manually.