Trigbf

From Esolang
Jump to navigation Jump to search

Trigbf is an esolang invented by User:None1, inspired by brainfuck.

Trigbf is also known as Trigbf7, you'll know why in the Dialects section.

Memory

Trigbf uses an unbounded (in both directions) tape which contains signed unbounded infinite-precision real numbers. Initially, every cell is zero.

Commands

Trigbf has these commands:

  • ,.><[]: The same as bf, except ., which rounds before printing as ASCII.
  • s: Let current cell value be x. x becomes sin(x rad) after the command.
  • c: Let current cell value be x. x becomes cos(x rad) after the command.
  • t: Let current cell value be x. x becomes tan(x rad) after the command. It is undefined behavior to run this command when current cell is an invalid value for tangent (e.g.: pi/2).

Dialects

Trigbf has 8 dialects: Trigbf0 to Trigbf7. After converting the dialect number (0~7) to a big-endian binary number, the 1st, 2nd and 3rd digits decide whether the s, c and t commands are available: 0 if unavailable, 1 if available. The original Trigbf has all three commands, so it's also known as Trigbf7.

Examples (In Trigbf7)

Cat

c[,.]

or:

,[.,]

Computational class

Dialects without the c command are FSAs because they can't do anything to the tape, making the tape useless.

Dialects with the c command are Turing-complete because brainfuck is Turing-complete even if only changing 0s into 1s is allowed.