ABCs

From Esolang
Jump to navigation Jump to search

ABCs is an esoteric programming language created by User:paul2520 in 2015. It uses the letters of the alphabet as commands.

History

ABCs was created in 2015 as a language that would enable works of literature such as poems or books to be executed. More realistically, English phrases can be written that would execute meaningful combinations of instructions.

Initially, this language was designed to be an acrostic, where each command stood for a word or phrase describing what it does. This is true for some of the commands.

The goal for implementations is to allow programs to do multiple things if the set of instructions are changed. The user may specify lower (default) or upper-case letters to be interpreted. The user may alternatively change which commands are used by passing in a string of characters of length 26. In this way, programs can be obscured if the command list is not given. Also this means that one code listing may be able to do many different things by changing the input set of commands.

Specification and Instruction list

The default instruction list is as follows. All other characters are ignored.

a     adds the numeric value of the next valid character to the accumulator
b     subtracts the numeric value of the next valid character from the accumulator
c     clears the accumulator
d     deletes current item in queue
e     empty (prints the current value in the queue and sets it to zero)
f     function; the next valid character is the name of the function
g     execute function where the name is the next valid character
h     hold (pause)
i     input value and store at end of queue
j     jump to k
k     location for jump to land
l     load value from queue to accumulator
m     multiplies accumulator with next element in queue
n     move to next element in queue
o     move to previous element in queue
p     move to top of queue
q     query user "?" --> enter y or n; branch to r or s, respectively
r     label for y
s     label for n
t     test if value in accumulator is 0 or 1; branch to u or v, respectively
u     branch for 0
v     branch for 1
w     while queue not empty, run commands up to next 'x'
x     jump back to w
y     "yell" --> print numeric value in accumulator to screen
z     zero out current element in queue

For interpreter implementations, the user may switch the instruction set of "abcdefghijklmnopqrstuvwxyz" with a 26-character array of their choosing.

Examples

Hello world

aheaeealealeaoeaqaqbabaeaweaoearealeade

External resources