VBF

From Esolang
Jump to navigation Jump to search

VBF is a brainfuck derivative by VilgotanL with some extra instructions for control-flow.

Instructions

New instructions compared to brainfuck:

( Begin if zero
!( Begin if not zero
) End if
{ While zero
} End while zero

Single-line comments are also supported, with #.

Examples

Cat program

Same as in brainfuck.

,[.,]

Infinite counter

Counts to infinity in base 10 starting with 1.

->>--<<[>---------(----------)++++++++++{>++(++>--
<)-----------(----------)++++++++++}++[-->++]--<+[
+++++++++++++++++++++++++++++++++++++++++++++++.--
----------------------------------------------<+]+
+++++++++.-----------]

The above program transpiled to brainfuck and minified:

->>>>--<<<<[>>---------[->+>>+<<<]>>>[-<<<+>>>]+<<[[-]>>-<<]>>[-<<<---------->>>
]<<<++++++++++[->+>>+<<<]>>>[-<<<+>>>]+<<[[-]>>-<<]>>[-<++[->+>>+<<<]>>>[-<<<+>>
>]+<<[[-]>>-<<]>>[-<<<++>>-->]<<<-----------[->+>>+<<<]>>>[-<<<+>>>]+<<[[-]>>-<<
]>>[-<<<---------->>>]<<<++++++++++[->+>>+<<<]>>>[-<<<+>>>]+<<[[-]>>-<<]>>]<<<++
[-->>++]--<<+[+++++++++++++++++++++++++++++++++++++++++++++++.------------------
------------------------------<<+]++++++++++.-----------]

Transpilation table

Here is a table for transpiling VBF to brainfuck:

VBF brainfuck
> >>
< <<
( [->+>>+<<<]>>>[-<<<+>>>]+<<[[-]>>-<<]>>[-<<<
!( [->+>>+<<<]>[-<+>]>>[[-]<<<
) >>>]<<<
{ [->+>>+<<<]>>>[-<<<+>>>]+<<[[-]>>-<<]>>[-<<<
} [->+>>+<<<]>>>[-<<<+>>>]+<<[[-]>>-<<]>>]<<<

All other instructions are the same.

Computational Class

VBF is obviously Turing-complete since it is basically backwards-compatible with brainfuck.

Implementations

Online Interpreter and Transpiler by the creator