Abc

From Esolang
Jump to navigation Jump to search
Not to be confused with ABC, ABC (compiler), nor AlPhAbEt.

Introduction

Abc is an Esolang inspired by the Alphabet.

There are 3 main values. The clv, cl and ptr. clv is what the current line contains and is what is printed to the screen on a newline, and is zeroed every newline. cl is exactly the same as the Brainfuck cell array, and ptr is the same as the Brainfuck pointer.

Commands

Letters

Majuscule letters add to clv, miniscule take away from clv.

Letter Value
A 1
B 2
C 4
D 8
E 16
F 32
G 64
H 128

Though the maximum value you can make by using only one of each letter is 255, the clv is not restricted, it can even go above Int-64 max. This is the same for the cl.

Other

Character(s) Function
+ Push clv to cl[ptr]. This doesn't zero clv.
- Push cl[ptr] to clv. This doesn't zero cl[ptr].
> Increment ptr.
< Decrement ptr.
/ Set return point for \
\ Go to the matching /, no matter what.
[ If clv is not 0 carry on, otherwise move to matching ].
] If statement end.
? Set clv to the ordinal of a single byte input.
(newline) Print then zero clv.
{ Start comment.
} End comment.
! See (newline).
(pipe) Ignore next newline.

Methods

Using the functions and letters provided, we can do most brainfuck things.

Brainfuck Abc
,[.,] /?!\
[-] /-a+!\
++++++++++[>+++<-]++. DB+/[>-BA+<-a+][\]
+++[>+<-] BA+/[>-A+<-a+][\]

Usability

Turing

According to my knowledge this is Turing complete.

IO/Files

Using cat one could use this to make an automated file read/write program.