No description
Find a file
2023-04-15 15:38:17 -04:00
deployments/aur add aur deployment 2023-04-15 15:38:17 -04:00
src fix bug and add zero instruction 2023-04-15 01:04:50 -04:00
.gitignore Added cmakelists lol 2023-04-13 20:44:55 -04:00
CMakeLists.txt Added cmakelists lol 2023-04-13 20:44:55 -04:00
LICENSE brainfucked 2023-04-13 17:04:05 -04:00
Makefile fix makefile 2023-04-13 18:31:29 -04:00
readme.md fix bug and add zero instruction 2023-04-15 01:04:50 -04:00

Brainfucked

Its brainfuck but with manual memory allocation :3

All normal brainfuck is valid brainfucked. Though your tape only starts with as much memory that can hold a pointer. In other words, if you're on a 64 bit computer you get 8 cells, and if you're on a 32bit computer you get 4 cells.

Pointers in brainfucked span as many cells as they are bytes.

Just like brainfuck, cells wrap from 0 to 255, and vice versa, and also the tape wraps from front to end and end to front. The tape will not wrap though if you are inputting a string.

Commands

< Move pointer left

> Move pointer right

+ Increment cell by one

- Decrement cell by one

[ Jump past the matching ] if the cell at the pointer is 0

] Jump back to the matching [ if the cell at the pointer is nonzero

. Output ascii at current cell

, Input ascii into current cell

* Allocate new tape size of current cell and replace with pointer

! Free allocated pointer in current cell

( Go to tape at pointer in current cell

) Leave tape last entered

` Output null terminated string at current cell

~ Input string into current cells with max length in current cell

% Clear screen

$ Zero n cells where n is the value of the current cell

\ Comment out the rest of the line

Usage

The brainfucked command expects only one argument which is the path to a file containing brainfucked.

For example:

$ brainfucked helloworld.bfd

Brainfucked can also read from standard in, so the following would also work.

$ cat helloworld.bfd | brainfucked

License

This project is Licensed under the WTFPL

Compilation

Linux / Mac

Make sure to have gcc and make installed, and then run

$ make # compiles the program
$ sudo make install # installs the binary

If you wish to remove the program, you can run

$ sudo make uninstall # removes the binary

Windows

Uh someone made a cmake file, you can use that. Just do the thing for the thing and the thing will work.