MCBlocks

From Esolang
Jump to navigation Jump to search

MCBlocks is a three dimensional esoteric programming language created by User:Dominicentek. It's code is written as a build in a Minecraft world with each block representing a command that the interpreter follows. The interpreter accepts .nbt files exported by Structure Blocks. The command pointer starts at XYZ 0 0 0 of the structure moving in X+ direction. Because of the Structure Block limit, each program is limited to 48x48x48 grid.

Blocks

Block Description
Oak Planks Moves the command pointer X+
Spruce Planks Moves the command pointer X-
Birch Planks Moves the command pointer Y+
Jungle Planks Moves the command pointer Y-
Acacia Planks Moves the command pointer Z+
Dark Oak Planks Moves the command pointer Z-
Dirt Pops a value off the stack
Cobblestone Reverses the stack
Stone Swaps the first 2 values
Deepslate Duplicates the top value on the stack
Cobbled Deepslate Pushes a number of values currently on the stack (This number not included)
Block of Iron Pops two values X and Y, performs a Math operation Y + X and pushes the result
Block of Coal Pops two values X and Y, performs a Math operation Y - X and pushes the result
Block of Gold Pops two values X and Y, performs a Math operation Y × X and pushes the result
Block of Diamond Pops two values X and Y, performs a Math operation Y ÷ X and pushes the result
Block of Netherite Pops two values X and Y, performs a Math operation Y % X and pushes the result
White Wool ... Black Wool Pushes current wool color on the stack (White = 0, Orange = 1, Magenta = 2, ..., Black = 15)
Sign Pushes ASCII characters of the sign on the stack (multiple lines are joined by a space, empty lines are ignored)
Block of Lapis Lazuli Asks user for number input
Block of Emerald Asks user for string input (ASCII values will then be pushed)
Block of Quartz Outputs top value of the stack as a number
Block of Redstone Outputs top value of the stack as an ASCII character
Oak Log (Rotated in X axis) If the top two values match, The command pointer moves X+, otherwise it moves X-
Oak Log (Rotated in Y axis) If the top two values match, The command pointer moves Y+, otherwise it moves Y-
Oak Log (Rotated in Z axis) If the top two values match, The command pointer moves Z+, otherwise it moves Z-
Crimson Hyphae Pops two values off the stack X and Y. X is used as address and Y is used as value. Value is then put on the corresponding address in the heap memory.
Warped Hyphae Pops a value off the stack used as an address. It pushes a value on the stack that is on that address in the heap memory. If there is no value, a 0 is pushed.
Red Concrete Ends the program

Examples

Interpreter

Download

See also