Bayes Leaf

From Esolang
Jump to: navigation, search

Bayes Leaf is a cell-based esoteric programming language created by Peter Berg in 2013. It utilizes random number rolling.


Command Output
U Increments the current cell's value.
D Decrements the current cell's value.
Y Moves the cell pointer two places to the left if the current cell value is odd, and three places to the right if the current cell value is even.
Z Lifts up the cell pointer and places it on a random cell.
R Rolls a random number between 1 and 9.
Q Rolls a random number between 1 and 99.
R(X) Performs X — which can be any other command(s) — a random number of times between 1 and 9, then continues.
R(R(X)) Performs R(X) a random number of times between 1 and 9, then continues. R-command nesting can continue infinitely. Q can be substituted for R.
Fig Sets the current cell's value to the most recently rolled random number.
Bop If the current cell's value is zero, do nothing. If it is not zero, output the cell's value as an ASCII character.
Sn Fools the program into terminating.

Once initiated, a program loops until the Sun explodes, at which point it prints the front sprite of the Pokémon Bayleef from the Generation V Pokémon games, and then terminates. (An example sprite is available on Bulbagarden Archives.) If you use the Sn command and fool the program into thinking the Sun has exploded, it will do the same thing, but at a reduced speed of 16 pixels per second. Rest assured that when the Sun actually does explode, Bayleef will be printed very quickly.


Q: How large and numerous are the cells in Bayes Leaf?
A: There are infinite cells, and each cell's value is unbounded.

Q: Is it mandatory to use that particular Bayleef sprite, or can a conforming implementation display a cropped version using the 256 colors provided by modern terminals?
A: The latter option is correct.

Q: But if the Sun explodes—
A: Hush, you.