Reversible BitFuck (RBF) interpretor
Project description
rbf-lang
Reversible BitFuck (RBF) is a reversible Turing tarpit. It is based on a tape of bits and has 5 commands:
*
Toggle the current bit>
Shift the tape head right<
Shift the tape head left(
If the current bit is zero, jump past matching)
)
If the current bit is zero, jump to just after matching(
Here is an example program operating on 3 bits. Bit 0 is the source bit (x
), bit 1 is the target bit (y
) and bit 2 is the temporary bit (f
). Here the value of x
is being moved to y
.
# x=?, y=0, f=0
(>>*<<) # set f if x is set
>>( # if f is set
<(>*<)* # set y
<*(>>*<<) # unset x
>>)
<(>*<) # if y is set, unset f
we can run the above program on an example tape (100
) with rbf cli:
rbf run -t 100 "(>>*<<)>>(<(>*<)*<*(>>*<<)>>)<(>*<)" # outputs 010
Since RBF is reversible, we can easily create a move left program:
rbf reverse "(>>*<<)>>(<(>*<)*<*(>>*<<)>>)<(>*<)" # outputs (>*<)>(<<(>>*<<)*>*(>*<)>)<<(>>*<<)
installation
RBF can be installed from source with
pip install .
or from pypi with
pip install rbf-lang
links
(as of yet uncategorised links to related topics. Will be sorted and expanded in the future)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rbf_lang-0.2.0.tar.gz
.
File metadata
- Download URL: rbf_lang-0.2.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30e42da27079bd9f993c3d5590fcd7aeb00b7cfd4eba382fc9872885072e1285 |
|
MD5 | 19e21d711e4c5a29de51271bca9d7a75 |
|
BLAKE2b-256 | edbcc7926d909a52bcd15188485e1a98ed4fa591913221be79b0746e66bf68f0 |
File details
Details for the file rbf_lang-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: rbf_lang-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0073bc9e6d9455398639c96ebd7cb4801e791cb713946cbac53d407cef959fca |
|
MD5 | d0371b7f6dffcafb000e92c7f5a9dffe |
|
BLAKE2b-256 | 3fcefe8bd66b9a4ebd897c2e6747c06d1e2b29d8d02cb95ce3634330daffec87 |