Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.22 KB

README.md

File metadata and controls

55 lines (35 loc) · 1.22 KB

LibCube

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.

Prerequisite

Caveat

We have only developmented and tested this project on Mac OS.

Build

$ cmake . && make

Test

After build:

$ make test

Example

Make a 'F' turn then render:

Cube cube;
cube.Move(Instruction::F);

Renderer renderer;
renderer.RenderExpandedView(cube.GetState(), "/tmp/out.png");

Output:

Future Architecture

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.