TheA 3x3x3 memory cube (the default) begins with this initialization:
Each integernumber represents a cubelet (in a 3x3x3, there are nine cubelets on each face). After performing a 90° clockwise right turn (R1
in Cubically source), it would look like this:
002
002
002
111225333044
111225333044
111225333044
554
554
554
There are two other pieces of memory, which are simply registers - the notepad and the input buffer. The input buffer is read-only and always contains the most recently inputted value (values are only inputted when $
or @
are hit in the source). The notepad stores the result of mathematical operations.
Mathematical operations are performed on face values. A "face value" is the sum of adding all values on the given face index. For example, the face value of the top face (indexed 0
) immediately after initialization would be 0. The face value of the left face would be 9, the front would be 18, etc. The notepad (face index 6) and input buffer (face index 7) are initialized to zero.
Some mathematical operations are:
+x
- x specifies a face index, add its value to the notepad-x
- x specifies a face index, subtract its value from the notepad (storing result in notepad)_x
- x specifies a face index, modulo the notepad by its value (storing result in notepad)
Accidentally hit post, finishing up nowExamples
A cat program would look like this (no cube manipulations required):
(~-1/1=7&6@7)
( open loop
~ read input to input buffer
-1 subtract 9 from notepad
/1 divide notepad by 9 (yielding -1)
=7 compare notepad and input buffer for equality
&6 exit if notepad truthy (notepad == input buffer)
@7 print input buffer
) close loop
More
Cubically has been developed into a mostly functional language thanks to the collective efforts of me, TehPers (many bug fixes and feature ideas), Kamil Drakari (more bug fixes, feature requests, suggestions and algorithms) and Destructible Lemon (Cubically's name).
Useful links: