Skip to content

LibCube is a C++ library that provides simulation, rendering, and algorithms of Rubik's Cube.

Notifications You must be signed in to change notification settings

heronyang/libcube

Repository files navigation

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.

About

LibCube is a C++ library that provides simulation, rendering, and algorithms of Rubik's Cube.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published