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.

2DWays

From Esolang
Jump to navigation Jump to search

2dWays is a Brainfuck derivative made by User:Cordership that has a 2D tape grid instead of BF's 1D tape.

Instructions

Here are the instructions:

Command Meaning
> Move pointer right.
< Move pointer left.
^ Move pointer up.
v Move pointer down.
/ Increment the memory cell at the pointer.
\ Decrement the memory cell at the pointer.
. Output a number from the memory cell at the pointer as an ASCII character.
~ Output a number from the memory cell at the pointer as an integer.
# Store the memory cell at the pointer in the pointer.
$ Duplicate the memory cell at the pointer , one copy goes in the pointer, the other stays in that memory cell.
, Get character from user and store it in the memory cell at the pointer.
& Get integer from user and store it in the memory cell at the pointer.
[] While the current memory cell is nonzero…
() While the current memory cell is zero…
{} If the current memory cell is nonzero…
:; If the current memory cell is zero…
0-9 Set the memory cell at the pointer to the corresponding number.
+ Add the current memory cell with the pointer, then store it in the current memory cell.
- Subtract the current memory cell from the pointer, then store it in the current memory cell.
* Multiply the current memory cell with the pointer, then store it in the current memory cell.
d Divide the current memory cell by the pointer, then store it in the current memory cell. Rounded down.
% Store the remainder of the integer division current memory cell/pointer in the current memory cell.
` Exponentiate the current memory cell to the pointer, then store it in the current memory cell.

Examples

Hello, World!

!73!.>!101!.>!108!.>!108!.>!111!.>!44!.>!32!.>!87!.>!111!.>!114!.>!108!.>!100!.>!90!.

Infinite loop

+v+<+^+>+v+[<^>v]

A+B problem

&>&#<+

Reverse cat

>,[>,]<[.<]