Cubically is too tedious to manually write any code in. Your challenge is to translate ASCII text into Cubically source code.
This is just a quick run-down of Cubically; the repository has a more complete guide and details.
Cubically is an esolang I wrote a while ago, designed to be painful to use. It contains two pieces of memory, a 3x3x3 Rubik's Cube and a register called the "notepad".
The internal Rubik's Cube is initialized like this:
000 000 top face 000 111222333444 left, front, right, and back faces, respectively 111222333444 111222333444 555 555 down face 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
A non-integer character sets the default command. For each integer before the default command is set once again, the command is performed with that integer. For example,
x524y312 would perform command
x with 5, then with 2, then with 4, then perform command
y with 3, then with 1, then with 2.
The integers that commands use represent face indexes. So
x0 would perform
x on the UP (0-indexed) face.
x1 would perform
x on the LEFT (1-indexed) face, and so on.
Performing any command with
6 will perform that command on the notepad value. Performing any command with any integer over 6 will result in an error.
Here are some example commands:
R1- turn the RIGHT face clockwise 90° so the internal cube will look like the second example above
R11- turn the RIGHT face clockwise 90° twice, identical to
+0- add all values of the UP face to the notepad
+000- add all values of the UP face to the notepad three times
@6- print the nonexistent 6th-indexed face (memory) as a character
%4- print the sum of all values on the BACK face as an integer
A complete list of commands and syntax is available at the repository.
You will take ASCII text as input and print a Cubically program as output.
Input -> Output Hello, World! -> +53@6+1F2L2+0@6L2F2U3R3F1L1+2@66L3F3R1U1B3+0@6:4U1R1+00@6-000@6*0-4+000@6-00@6+2-000000@6-5+4000@6-00@6/0+00@6:0+0/0+00@6 1$2$3$4$5$6$7$8$9$10$ -> B1+2/2%6@4+00/0%6@4+00/1%6@4+21/1%6@4+30/0%6@4+22/1%6@4+22/1%6@4+40/1%6@4+52/1%6@4+42/1%6@4
- Your program may not contain a dictionary containing the translations for the 100 testcases.
- Your program must finish in less than 180 seconds (no brute-force programs that take weeks).
- Your program must output valid Cubically code that finishes in less than 180 seconds.
- Your program will take input via standard input, unless you want to mess with the test driver.
- Your program must output Cubically code that produces nothing but your program's input when run. ಠ_ಠ
You will test your program with 100 pseudorandom strings of pseudorandom length. (A bash script is provided that will do this for you.) Here is how you will score:
- Let the length of the output program be o.
- Let the length of the input string be l.
- Let a variable r be the result of o/l.
- Find the average of all r: (r1 + r2 + r... + r100) / 100.
Test with this script. You'll have to modify it as instructed. Note that the program does not check whether the output is valid Cubically code. If you can't get the script working, I can help. Ping me in the Cubically chat room.