Brainterpart

From Esolang
Jump to navigation Jump to search

Brainterpart is an esolang invented by User:None1, inspired by brainfuck, it is the counterpart of brainfuck without comments.

Definitions

Define the brainfuck charset (BC for short) as +,-.<>[].

Define the non-brainfuck charset (NBC for short) as the charset which contains characters that aren't in BC with ASCII values between 33 and 126 (! to ~, inclusive).

Define brainfuck string as a string that only consists of characters in BC.

Define non-brainfuck string as a string that only consists of characters in NBC.

Define the string number of a string in a charset of length N+1 as the result of replacing each character with a base-N+1 digit. (e.g.: The string number of the brainfuck string +. is (14)8=12).

Programs

Programs in brainterpart are non-brainfuck strings, which are converted to brainfuck strings when executing.

Let A be the infinite sequence of brainfuck strings sorted by their string number.

Let B be the infinite sequence of non-brainfuck strings sorted by their string number.

The conversion is a mapping from A to B:

A: !  "  #  $  %  &  '  (  )  *  ...
   ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
B: +  ,  -  .  <  >  [  ]  ++ +, ...