Invy

From Esolang
Jump to navigation Jump to search

Invy /ɪn.ˈviː/, whose name has nothing to do with envy or any other word, is an esoteric programming language created by CreeperBomb in 2023.

Code format & memory system

Instead of being written left to right and top to bottom, code is written (and read) top to bottom and left to right. This is done to make the programmer get a "movie h4ckr vibe", and implementations are encouraged to use a green-and-black theme for the text instead of black-and-white or white-and-black. For example, if your program had "foo[newline]bar" in it, it would be written as

fb
oa
or

Memory exists on a right-infinite tape initialized to 0s, and the pointer starts all the way on the left. If the pointer tries to go left on the leftmost cell, it does not move. The initial set-up of the tape is input, and the tape can be viewed at (and edited if the implementation allows so, though this editability is not necessary) at any time.

Instructions

Symbol Explanation
0 Go right
1 Go left and flip that bit
[space] Seperates "branches"

If in a column you put a space and visible code on either side, such as in the example below, the top path will be taken if the leftmost bit is 0 and the bottom path if its 1. What "taken" means will be explained shortly.

0
0
1
1
 
0

When reaching the bottom of a branch, the machine checks if the pointer is on a bit set to 1. If not, the branch is run again; otherwise, the next column is considered. If there is no space, the column is run. If there is a space, the previously described method is used to determine which branch to take. Note that if the leftmost bit is changed, the branch run will switch without the next column being run.

After the last column, it wraps back around to the first column being run. Whitespace that makes no visible impact or composes a blank column/branch is ignored.

Example programs

Truth machine (input on leftmost bit):

0

0
0
1