BFPI: Exactly what it sounds like
Project description
BFPI
BFPI: Exactly what it sounds like
#What is bf?
https://en.wikipedia.org/wiki/Brainfuck
(tl,dr;)
You can run bf in this bf+ interpreter because we can translate bf to bf+.
#What is bf+? Differences: infinite cells, lists in cells, negative cells, more loops, etc.
There are 37 key phrases in bf+. Because bf+ can do everything bf can, it is turing-complete:
(There are also 37 key words, not including 21 cap letters except 'P', 'F', 'O', 'Q', and 'I').
37+21=58
bf | bf+ |
---|---|
+ | + |
- | - |
, | iscwv (only case where bf+ is more complex) |
. | o |
> | d |
< | a |
[CODE] | [CODEl] |
Like bf, bf+ ignores non-keyword phrases.
NOTE: All cap letters after 'p', 'P', 'f', or 'F' are also keywords.
Character, Meaning, Type, And If they have been changed dramatically from bf
+ : add current cell by 1 if current cell is not a list, else raise an error|Modify|No
- : subtract current cell by 1 if current cell is not a list, else raise an error|Modify| No
0 : makes current cell value 0|Modify|Sort of, same as [-] in bf but original ver won't work with neg values
a : move 1 cell to the left; if already at position 0 raise an error|Move|Not really, same as < in bf
d : move 1 cell to the right|Move|Not really, same as > in bf
s : if current cell is list, go into list at index 0; else make it a list and go into list at index 0. Technically if it is near 100th recursion will raise recursion error in python|Move|Yes
w : if current cell is in list, go to cell that contain the list; else raise an error|Move|Yes
i : input the input as their ord() values in a list, stores the list to current cell|I/O|Sort of, similar to , in bf but support more chars; bf , is equivalent to bf+ iscwv, only the later being more general
I : input a number and store it to cell|I/O|Sort of, but accessible in bf using long programs, not including neg ints.
o : output the char of ASCII value of cell if the cell is of type value (neg or bad values raise errors), else output the string containing all chars of ASCII values in the string (for simplification doesn't include '0' values)|I/O|Sort of, first usage equivalent to . in bf but second impossible (I think)
O : output the value of the cell directly if it is of type value, else raise an error|I/O|Sort of, but accessible in bf using long programs, not including neg ints.
c : copy the value of cell (int or list)|Copy Paste|Yes, as one of the strongest features in bf+ (although pos int or 0 copy and paste is possible in bf, neg int is not do-able and thus lists with them not do-able too)
v : paste the value of cell (int or list)|Copy Paste|Yes, as one of the strongest features in bf+ (although pos int or 0 copy and paste is possible in bf, neg int is not do-able and thus lists with them not do-able too)
p : make a portal. pH make a portal named H, etc. Technically should only have 1-char caps except 'P' as portal name|Portal|Yes, as one of the strongest features in bf+
P : go to a portal. PH go to the portal named H, etc.; if portal undefined raise an error|Portal|Yes, as one of the strongest features in bf+
fNCODEf : make function named 'N' with definition CODE; there is no reason to stack this and such stacking will cause errors|Function|Yes, as one of the strongest features in bf+
FN : call function named 'N'; if function undefined raise an error|Function|Yes, as one of the strongest features in bf+
(CODE) : execute code inside if current cell is 0|Loop|Yes, as goes all the loop features except [CODEl]
[CODE] : execute code inside if current cell is not 0|Loop|Yes, as goes all the loop features except [CODEl]
{CODE} : execute code inside if current cell is > 0|Loop|Yes, as goes all the loop features except [CODEl]
<CODE> : execute code inside if current cell is < 0|Loop|Yes, as goes all the loop features except [CODEl]
,CODE; : execute code inside if current cell is >= 0|Loop|Yes, as goes all the loop features except [CODEl]
.CODE: : execute code inside if current cell is <=0|Loop|Yes, as goes all the loop features except [CODEl]
/CODE\ : execute code inside|Loop|Yes, as goes all the loop features except [CODEl]
(CODEl) : repeatly execute code inside as long as current cell remains 0 (position of 'current cell' aforementioned might change due to CODE inside) (code doesn't include character 'l', the letter in jk'l'mn)|Loop|Yes, as goes all the loop features except [CODEl]
[CODEl] : repeatly execute code inside as long as current cell remains not 0 (position of 'current cell' aforementioned might change due to CODE inside) (code doesn't include character 'l', the letter in jk'l'mn)|Loop|No, it is the only loop in bf: the [] loop
{CODEl} : repeatly execute code inside as long as current cell remains > 0 (position of 'current cell' aforementioned might change due to CODE inside) (code doesn't include character 'l', the letter in jk'l'mn)|Loop|Yes, as goes all the loop features except [CODEl]
<CODEl> : repeatly execute code inside as long as current cell remains < 0 (position of 'current cell' aforementioned might change due to CODE inside) (code doesn't include character 'l', the letter in jk'l'mn)|Loop|Yes, as goes all the loop features except [CODEl]
,CODEl; : repeatly execute code inside as long as current cell remains >= 0 (position of 'current cell' aforementioned might change due to CODE inside) (code doesn't include character 'l', the letter in jk'l'mn)|Loop|Yes, as goes all the loop features except [CODEl]
.CODEl: : repeatly execute code inside as long as current cell remains <=0 (position of 'current cell' aforementioned might change due to CODE inside) (code doesn't include character 'l', the letter in jk'l'mn)|Loop|Yes, as goes all the loop features except [CODEl]
/CODEl\ : repeatly execute code inside (code doesn't include character 'l', the letter in jk'l'mn)|Loop|Yes, as goes all the loop features except [CODEl]
#CODE# : ignore code inside, used for commenting. make sure pairing symbols pair. DO NOT STACK THIS|Comment|Yes, as it is not needed in bf
initial loop comment. : supported: [], {}, <>, [l], {l}, <l>, but make sure pairing symbols pair|Comment|Sort of, as only [l] is supported in bf
q : quit function
Q : quit entire program
' : print character \t
" : print character \n
| : break 2 loops
_ : restart 2nd loop (but still checks condition before execution)
119 lines!!! GOD!!!
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 BFPI-4.0.1.tar.gz
.
File metadata
- Download URL: BFPI-4.0.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1df50b688c0d95a77702c14bd2ea897080f764727ca483f7cb04051ef29b68b0 |
|
MD5 | 3323817a5b53e7266967c9f0eb957397 |
|
BLAKE2b-256 | 79921d606ede093a2c55a5a389b3c7e60928f9dd7918a1517fbe34cdf64c79d7 |
File details
Details for the file BFPI-4.0.1-py3-none-any.whl
.
File metadata
- Download URL: BFPI-4.0.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef62f9458531216d75b363673a9c0009da8b19c64434d37dceba379f494bd6ad |
|
MD5 | 02358913c94c6c1f943cd3df14e5eefc |
|
BLAKE2b-256 | e4692ab60d94fef8f08a187a4c1127df1f5e0787d2418523dd7f0b61e1a8a9f7 |