BytFuck

From Esolang
Jump to navigation Jump to search
Not to be confused with Bitfuck

BytFuck is a brainfuck derivative which means it's inspired by the brainfuck esoteric language.

The "thing" that makes this unique

This language is exactly brainfuck but in original brainfuck you had a pointer pointing to a cell in a tape.
Now there are 2 pointers, 1 pointer pointing to a cell, but the other pointer is pointing to a bit in that cell.

I didn't understand

I know that you didn't.

Let's say this is normal brainfuck with the pointer, the cells, the tape, well in this brainfuck there are two pointers.
The first pointer is pointing to a cell, like normal brainfuck.
One cell is made by 8 bits (1 byte), 8 bits looks something like this: 0 0 0 0 0 0 0 0
Now there is one pointer pointing to a bit, which bit points? Is pointing to a bit in a byte, the same byte pointed by the other pointer.
And when you move the other pointer, this pointer also moves to the other byte.

New instructions

Instruction Description
Move bit pointer to right
Move bit pointer to left
* Flip pointer bit
! Make bit pointer to point the first bit in the cell
( ... ) Executes the code inside of the parenthesis if the pointed bit is 1

Examples

Setting Bits

The following program replicates the ASCII code of the letter “A” (decimal value: 72) in a binary format, as 01001000, and prints the corresponding character:

≤≤≤*≤≤≤*.

Truth-Machine

The following compendious truth-machine implementation exploits the fact that the binary representation of the ASCII code of the character “0” bears a zero-valued bit on its first (lowest) position, while the equivalent character “1” expression contains a one-bit:

,([.]).

Bitwise Negating Cat Program

The following repeating cat program accepts a character, inverts its bits, and prints the resulting character to the standard output, until a null character input has been issued:

,[!*≤*≤*≤*≤*≤*≤*≤*.[-],]

Interpreter

  • Common Lisp implementation of the BytFuck programming language. Please note that the concrete character set deployed constitutes a dependency on the Common Lisp implementation; in corollary, Unicode support may or may not be a feature incorporated in the personal environment. The interpreter at hand has been developed and tested with Steel Bank Common Lisp (SBCL) version 1.1.4 as part of the Lisp Cabinet 0.3.5 bundle.