We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

NDBF

From Esolang
Jump to navigation Jump to search

NDBF (short for N-dimensional brainfuck) is an esoteric programming language created by User:Mutasimos in 2026.

Preprocessor

There is a preprocessor in this language. You can use

$from.into$

to find-and-replace all instances of "from" into "to". This is useful for aliasing the () command into a shorter command. Supported escape codes:

Code What it emits
\\ \
\. .
\$ $

The Language

These are all the characters:

Character What it does
+ Increment number at current cell
- Decrement number at current cell
( Start of movement command
) End of movement command
. Output current cell to standard output as a character
, Input standard input to current cell as a character
[ If current cell is 0, jump to the command after the matching ]
] If current cell is 1, jump to matching [
Anything else No operation (NOP)

You can use ( and ) like so:

(+1, -1)

This will move +1 cell in the X direction and -1 cell in the Y direction. This also supports moving multiple cells, like so:

(+4)

This will move +4 cells in the X direction.

Also, you can only use up to 5 cells in one axis, forcing you to use other axes.

Examples

Hello, world

With comments:

$>.(+1)$                       Movement for positive X
$<.(-1)$                       Movement for negative X
>++++++++[<+++++++++>-]<.      H
>>++++++++++[<++++++++++>-]<+. e
+++++++.                       l
.                              l
+++.                           o
>>++++[<+++++++++++>-]<.       comma
------------.                  space
<<+++++++++++++++.             W
>.                             o
+++.                           r
------.                        l
--------.                      d
>+.                            !
[-]++++++++++.                 newline

Without comments and newlines:

$>.(+1)$$<.(-1)$>++++++++[<+++++++++>-]<.>>++++++++++[<++++++++++>-]<+.+++++++..+++.>>++++[<+++++++++++>-]<.------------.<<+++++++++++++++.>.+++.------.--------.>+.[-]++++++++++.

Cat program

It is the same as brainfuck (a Polyglot between NDBF and brainfuck)

,[.,]

This is because this program uses no movement commands.