- Not to be confused with Cubix.
Please note than my english can be bad. My local languague is not english.
Cubik is an esoteric programming language created by User:Fabiot, which was made to be programed with a wikipedia:Rubix's Cube, hence the name. By now, it's only in its first version (v1.0).
Without further ado, lets see the:
Commands!!! (or better said, turns)
Make it so that the front layer is green and the upper layer is white.
Good moment to say that I don't know if Cubik is Turing-complete.
Stack turns
| Turn |
What it does
|
| U |
Push 0 to the stack
|
| U' |
Pop a value from stack and do nothing
|
| U2 |
Duplicate top value of the stack
|
| D |
Swap the top two values on the stack
|
Open (remember) register
| Turn |
What it does
|
| D' |
Pop a value from the stack and remember it
|
| D2 |
Push the last remembered value into the stack, then forget it
|
Aritmethic
| Turn |
What it does
|
| M |
No-op
|
| M' |
Increment the top value of the stack by one
|
| M2 |
Decrement the top value of the stack by one
|
| L |
Pop A and B, then push A plus B
|
| L' |
Pop A and B, then push A minus B
|
I/O
| Turn |
What it does
|
| B' |
Push a UTF-8 character from input to the stack
|
| B2 |
Pop the top value of the stack and output it as a UTF-8 character
|
Flow control
| Turn |
What it does
|
| R |
Pop from the stack, and jump to the label matching the value popped
|
| R' |
If the second top-most value is 0, jump to the label matching the top-most value of the stack. This does not change the stack
|
| R2 |
End the last label if there was one and define a new label starting here
|
The most important turns
| Turn |
What it does
|
| F |
Start program
|
| F' |
End program, but don't halt it
|
Better say now that it doesn't have an official interpreter, so I'm challenging you to program an interpreter.
Examples!
Does nothing
F
M
F'
F
B'
B2
F'
F
B'
M
B'
L
B2
F'
You can discuss for more examples!