Fluid

From Esolang
Jump to navigation Jump to search

Fluid is an esolang devised by User:Yayimhere, in a few minutes, after reading the esolang article on BIX Queue Subset's. It is the BIX queue subset cffda cttda d. Note that the c is skipped if not in idle mode.

A non BIX definition

Fluid has a queue of bits. It also has a boolean register, that can have the values 1, 0, and NaB, where NaB stands for "Not a Bool"; Its default value is NaB. Below is its command set:

  • n: set the boolean register to NaB.
  • 1: set the boolean register to 1, if an only if it is NaB, then check if the boolean register is 1; if true enqueue a 1 twice, else do nothing; set the boolean register to NaB, and then shift a value of the queue, then set the boolean register to that value.
  • 0: does the exact same process as 1, however enqueue a 0.

Note that the queue never will have a NaB in it.

The data queue can be defined, by having a list of bits. Then a space and the command list. The list of bits is read left to right, so the leftmost bit is at the front of the queue. We loop over the entire program again and again until it halts

For an example, lets take the (most likely) useless program:

101 101n

which gives the sequence:

command:      queue:
1             0111
0             11100
1             1100
n             1100
1             10011
0             001100
1             0110011
n             0110011
1             11001111
0             1001111
1             0011111
n             0011111

and so on. Note the diagonal lines of 00 pairs in the queue.