| common | Add compiler, extend buffer size to 65536 bytes | |
| compiler | Add compiler, extend buffer size to 65536 bytes | |
| debugger | Debuger: fix out of bounds message position; make targets phony | |
| examples | Add compiler, extend buffer size to 65536 bytes | |
| .gitignore | Add compiler, extend buffer size to 65536 bytes | |
| LICENSE | Add compiler, extend buffer size to 65536 bytes | |
| Makefile | Debuger: fix out of bounds message position; make targets phony | |
| readme.md | Add compiler, extend buffer size to 65536 bytes | |
2dbf - Fucks your brains in 2d!
I know about some other 2d languages inluding various 2d brainfuck dialects, but they are using a lot of additional operators for navigation, what kinda violates the idea behind brainfuck.
This implementation introduces 2 more operators:
@ - end, and ? - conditional direction change,
and removes [ and ] operators as of they are replaced with ?.
Structure
It contains compiler in directory compiler and "debugger" in debuger.
Debugger in quotes becouse now all it is doing is shows program execution.
Build
Debugger depends only on ncurses library.
Compiler depends on qbe and gas (part of binutils).
To build run make
Usage
To understand code you have a debuger, which shows how program is executed and its state. Pressing any key will trigger next steq, q - quit.
Language operators
| operator | action |
|---|---|
| < | move stack pointer left |
| > | move stack pointer right |
| + | increment current value |
| - | decrement current value |
| . | print current value (translated to ASCII) |
| , | write user input in point |
| ? | change direction: if moving by x then up if current value < 0 and down if > 0; if moving by y then left if current value < 0 and right if > 0 |
| @ | stop program |
All other characters are ignored. There are some examples, so you can try to understand something from them.