afz

From Esolang
Jump to navigation Jump to search

Afz is invented by User:A.

Furthermore, I recommend that the official #esoteric character set of 12 different characters for transmitting messages redundantly through a 7-bit serial line shall be: +,07HOSTafz}. afz stands for Another Foolish ...what?

Commands

An afz program executes backwards. Items in a lookup table do not have to be even.

A string-pushing command starts when a character is alphabetic, and ends when the character is not the same case as that character or is non-alphabetic.

The stack is right-ended; that is, you push items from the right to the left, and you pop items from left to right.

Input will prepopulate the stack.

Command Response
} Begin a lookup table preservation by taking items from the stack. At the end of the program the lookup table will be printed.
afz Push the string "zfa" onto the stack.
HOST Push the string "TSOH" onto the stack.
1-9 Duplicate the top-of-stack string 1-9 times and push it.
0 Duplicate the top-of-stack string 0 times and push it. I.e. push an empty string.
, Push all first-items in the rows of the lookup table onto the stack.
+ Concatenate all of the items. Different items are separated by spaces.
. Concatenate top two items. Different items are separated by spaces.
- Remove all characters in the top of stack that is in the second-to-top of stack. It is case-insensitive.
! Convert the top of the stack to lowercases
~ Opposite of !
^ Capitalize the first letter
@ Return the value for the first occurence of the top of stack in the lookup table
$ Remove the first occurence of the top of stack in the lookup table
: Duplicate every character in a string

Examples

afz HOORAY

+5YAROOHzfa}

Exchange good and bad

^!-DABDOOGdoog}