|Computational class||Turing complete|
Mepytaruon is a non-textual turing tarpit programming "language" based on the Multicolor Tile Puzzle from the 2015 game Undertale. The name comes from smashing together the names of two characters from Undertale, who have employed the original puzzle, Papyrus and Mettaton.
To ensure turing completeness, Mepytaruon took inspiration from brainfuck's instructions. Instructions in Mepytaruon are written as tiles of different colors in a png image, with each tile having specific rules for Instruction pointer (IP) movement. Additionaly, where applicable, the magnitude of a three-dimensional vector of the RGB components of the tile's color may specify a variant of the base tile. Execution starts at [0, 1] (indexed from the top-left), with the IP attempting to move to the right, but the starting point may be moved and direction changed if an interpreter supports it. Every time the IP moves (doesn't matter if it moves on its own, or is moved by another tile), the tile it steps on gets activated.
The IP can have two flavors, LEMON and ORANGE (the fruit). Flavor acts like a flag.
Like brainfuck, Mepytaruon operates with an array of memory cells, each initially set to zero. Each cell is a 16-bit signed integer. The standard number of cells is 30 000, but interpreters can include an option to specify a different count. The memory pointer (from here on simply referred to as "pointer") is initially pointing to the first cell.
|Base color||Tile name||Movement rule||General action||Number of variants|
|#9CFF79||Green||No effect||Manipulates ptr||4|
|#FF4040||Red||Can't enter||Exits when attempting to enter||1|
|#FFFF80||Yellow||Bounces the IP back to the tile it came from||Changes dir||9|
|#FFC14A||Orange||Changes flavor to ORANGE if val is 0||Outputs val||4|
|#C000C0||Purple||"Slides" the IP in the direction it entered||Manipulates val||5|
|#4040FF||Blue||If next to a yellow tile or the flavor is ORANGE, acts as a yellow tile movement-wise. Acts like a pink tile otherwise.||If the flavor is ORANGE, changes movement direction like a yellow tile||9|
|#FFFFFF||White||No effect||Outputs contents of all memory cells||1|
More in-depth description of the individual tiles is provided below.
To make this document easier to read, constant values and instruction pseudocode will be written in capital letters (RIGHT, DOWN, OUTPUT).
Abbreviations: ptr – Pointer val – Value in a memory cell selected by the pointer dir – The absolute direction IP attempts to move in stdin – Standard input stdout – Standard output
Every tile has a different number of "shades" or variants, as seen in the "Number of variants" column in the table above, which change the tile's behavior slightly. For example, purple tiles manipulate values in cells, but one variant increments the value, while another sets it to zero.
Colors of different variants aren't fixed to the values listed below, those are only the standard colors. The exact method of calculating a variant number from the magnitude of a tile's color can be found in the source code of the original interpreter. The equations aren't listed here, because a lot of rounding and integer division takes place and thus makes making a single mathematical equation quite hard.
There are four directions in which the IP can move. Up, right, down and left. These directions are indexed clockwise as shown in the table below. The reason for two naming schemes is to distinguish when a direction is set and when the IP rotates (e.g. when "turning" REVERSE, the original absolute RIGHT becomes absolute LEFT).
|Ordinal||Absolute direction||Relative direction|
In-depth look at tiles
Here, I will describe every type of tile and their variations in more depth.
The pink tile doesn't do anything and doesn't affect movement.
Green tiles don't affect movement and manipulate ptr when stepped on.
A red tile acts like a wall, and as such, cannot be stepped on. When the IP collides with it (attempts to step on it), the program ends.
|4||#9B9B4E||ROTATE dir BY IDENTITY|
|5||#7F7F40||ROTATE dir BY RIGHT|
|6||#636331||ROTATE dir BY REVERSE|
|7||#464623||ROTATE dir BY LEFT|
Variants 0-3 set dir to an absolute direction; variants 4-7 apply a rotation to dir; variant 8 sets dir to val. For val larger than 3, variant 8 takes the remainder after dividing val by 4 (e.g. 7 % 4 = 3).
Walking onto a yellow tile "bounces" the IP back onto the tile it's come from (triggering the source tile again).
|1||#DFA840||OUTPUT val AS Int|
|2||#9F782E||OUTPUT val AS Hex|
|3||#5F481B||OUTPUT val AS Char|
The orange tile acts as an output tile. Variant 1 outputs val as an integer; variant 2 does the same, but in hexadecimal format; variant 3 converts val to a character, which then gets outputted.
Additionally, all orange tiles set the flavor to ORANGE if val is equal to zero (but don't reset it otherwise).
Purple tiles manipulate val. Variant 4 requests an integer from stdin and halts until it receives it. Purple tiles act like "ice" tiles. They continue moving the IP in the direction they've been entered, ignoring dir.
Additionally, they set flavor to LEMON.
|4||#27279B||ROTATE dir BY IDENTITY|
|5||#20207F||ROTATE dir BY RIGHT|
|6||#181863||ROTATE dir BY REVERSE|
|7||#111146||ROTATE dir BY LEFT|
Blue tiles are functionally the most complicated. The table above is (except for the colors) the same as the one for yellow tiles, but the actions may not be triggered based on these rules:
- If the flavor is ORANGE, act exactly like a yellow tile.
- If you neighbour a yellow tile, bounce the IP back like a yellow tile.
- If the flavor is LEMON, and you don't have any neighbouring yellows, act like a pink tile.
This means that blue tiles only manipulate dir when the flavor is ORANGE.
The white tile is a debug tile. It has no special movement rules. When stepped on it outputs the contents of all the memory cells and ptr to stdout if debug mode is enabled in the interpreter.
A simpler program that outputs 26. It has all the different tile variants on the bottom (that are not executed).
The original interpreter written in Kotlin can be found here