Readability

From Esolang
Jump to navigation Jump to search

Readability is an esolang that is 100% readable. It consists of only characters from the ASCII range \x00 to \x20 inclusive (the unprintable ASCII), along with a few other characters. It's created by User:Evylah.

Overview

Readability uses 2 registers (called X and Y). The 2 registers both can hold a single positive integer. Each register has separate commands that do different things, but the 2 values can be swapped. Readability also has file I/O, along with a file string to decide which file.

Instruction set

Special

Char Description
\x00 No-op.
\x0A Print a newline.
\x11 No-op for now until I decide what it does lol

Register manipulation and arithmetic

Char Description
\x01 Increment X.
\x02 Increment Y.
\x03 Decrement X.
\x04 Decrement Y.
\x05 Copy Y to X.
\x06 Copy X to Y.
\x07 Reset X to 0.
\x08 Reset Y to 0.
\x09 Swap contents of X and Y.
\x0B X = X + Y.
\x0C X = X - Y. Negative numbers will reset to 0.
\x0D X = X * Y.
\x0E X = X / Y. Uses integer division.
\x0F X = X + Y.
\x10 X = X ** Y.
\x12 X = X bitwise NAND Y. NAND every bit between X and Y.
\x13 X = bitwise NOT X.

Standard I/O

Char Description
\x14 \x15 Print Y as a Unicode character or as a number, in that order.
\x16 \x17 Request one character or one number from the user.

File I/O

Char Description
\x18 Add the character of Y to the file string.
\x19 User types the file string.
\x1A Open file with the name of the file string.
\x1B Y = the character X of the file contents. Raises an error if a file is not opened, and the first character is index 0.
\x1C Character X of file contents = Y as a character.
\x1D Close file and save changes. If a file was never opened, do nothing. If a program exits or errors out before the file is closed, close the file but don't save changes.

Conditional branching

Trying to jump to a label that doesn't exist will error the program.

Char Description
\x1E Create a label under the name of X.
\x1F Jump to label X unconditionally.
\x20 End program. This can be anywhere in the code.
\xA0 Jump to label X if Y is not 0
\x200B Jump to label X if Y is 0.

Examples

TBA