LibCube is a C++ library that provides simulation, rendering, and algorithms of Rubik's Cube. I design LibCube for developers to build applications on-top of it.
We have only developmented and tested this project on Mac OS.
$ cmake . && make
After build:
$ make test
Make a 'F' turn then render:
Cube cube;
cube.Move(Instruction::F);
Renderer renderer;
renderer.RenderExpandedView(cube.GetState(), "/tmp/out.png");
Output:
Today, I have only implemented the simulation part, and this section describes the architecture I'm planning to move forward.
LibCube is composed of three components:
- Simulation - the core component - simulates cube states after given turns.
- Renderer reads a simulated cube state and generates human-friendly images.
- Algorithm contains cubing algorithms that are compatible with Simulation.