Cubically

Cubically, the Rubik's Cube Programming Language, also called the Pain Cube or just plain Rubik's Cube, is an intensely, painfully complex esoteric programming language by User:MD XF.

This repository contains:


 * - cube operations
 * - the language
 * - a 2d cube visualizer/emulator

To build everything type. This will generate two executables,  and. either takes a file as a command-line argument or reads from standard input. # Memory

Cubically has an odd memory structure. The memory is a Rubik's cube. Various commands perform operations on this cube, such as turning the right face clockwise by 90 degrees. Other commands perform operations on certain faces of the cube, like adding all values on the top face together and storing them on the notepad (see below).

The six faces of the cube are initialized with the numbers 0 through 5, like this:

000  000   000 111222333444 111222333444 111222333444   555   555   555 After performing a clockwise 90° turn on the right face, the memory cube would look like this:

002  002   002 111225333044 111225333044 111225333044   554   554   554 To make Cubically an (almost) usable language, there is one other piece of memory: the &quot;notepad&quot; (also called the scratchpad). This can store one value at a time. Performing a command on the nonexistent sixth face index will perform the command on memory.

= Syntax =

A non-integer in the source code will set the command to that character. Each integer will execute the previous command, using that integer as an argument. There is no way to pass a value outside the range  to a command.

For example,  executes the command   with argument. executes  with , then with  , then with.

= Commands =

Memory commands:

Control flow:

General commands:

= Faces =