ABG

From Esolang
Jump to navigation Jump to search

ABG is an esoteric programming language made by User:ChuckEsoteric08 that uses only 4 commands: a, b, g and c.

Commands

Command Meaning
a Increment the current cell and move the pointer to the right.
b Decrement the current cell.
g Move the pointer to the left and go to the matching c if the current value equals 0.
c Go to the matching g if the current cell value does not equal 0.

There is also command for debug: # which outputs cell. Implementing it is unnsecesary.

gc

is just move pointer to the left and not start loop because there isn't anything between g and c If you want loop that does nothing, then you need this code:

g c

Examples

Infinity loop

agcg c

It is can be translated to BF like this:

+><[]

agc is same as + in BF. So BF equivalent is this:

+[]

Cat program

An infinitely repeating cat program is implemented in the following:

d#agd#aagcc

Truth-machine

This program implements a truth-machine:

d#bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbag
agcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagc
agcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagcagc
agcagcagcagcagcagcagcagc
#bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaagcc

ABGAD

ABGAD is ABG, but with input command d, # outputs as ASCII and command e which halts program.

Computational class

BF can be translated to ABG like this:

BF ABG
+ agc
- b
> ba
< gc
[ bag
] c

Interpreter

  • Common Lisp implementation of the ABG and ABGAD programming language.