Giter Site home page Giter Site logo

scramble-visualizer's Introduction

scramble-visualizer

A 2D virtual Rubik's Cube written in C++.

The main program can take any algorithm in WCA notation and apply it to the virtual cube to show the resultant state.

Screenshots

3x3 Superflip 6x6 Scramble 9x9 Scramble

Compiling

You need:

  • SFML 2.5+ development headers and library
  • C++17 compliant compiler
  • CMake build system

To compile, run CMake on the project directory with CMAKE_BUILD_TYPE=Release and you'll get Makefile or equivalent for your platform, with which you can compile the project.

On Linux and macOS:

~ $ git clone https://github.com/HueFlux/scramble-visualizer.git
~ $ cd scramble-visualizer
~/scramble-visualizer $ mkdir build/ && cd build/
~/scramble-visualizer/build $ cmake -DCMAKE_BUILD_TYPE=Release ..
~/scramble-visualizer/build $ make

Command-Line Version

Command-Line 5x5 Command-Line 5x5

By default, the SFML version of the project will be built with the method above. If you would instead like to build the command-line version of this project which does not use SFML, you need to run CMake with COMMAND_LINE=ON.

On Linux and macOS:

~ $ git clone https://github.com/HueFlux/scramble-visualizer.git
~ $ cd scramble-visualizer
~/scramble-visualizer $ mkdir build/ && cd build/
~/scramble-visualizer/build $ cmake -DCMAKE_BUILD_TYPE=Release -DCOMMAND-LINE=ON ..
~/scramble-visualizer/build $ make

Switching Between Versions

It is important to note that CMake cache variables persist during reruns of CMake, so in order to switch to the SFML version of the project after building the command-line version, you must either rerun CMake with COMMAND_LINE=OFF or remove CMakeCache.txt from the build directory and rerun CMake normally.

On Linux and macOS:

~/scramble-visualizer/build $ cmake -DCMAKE_BUILD_TYPE=Release -DCOMMAND-LINE=OFF ..
~/scramble-visualizer/build $ make

or

~/scramble-visualizer/build $ rm CMakeCache.txt
~/scramble-visualizer/build $ cmake -DCMAKE_BUILD_TYPE=Release ..
~/scramble-visualizer/build $ make

Changing Cube Size

By default, the virtual Rubik's Cube is a 3x3x3. To change the size of the cube you must change the size value N in include/cube.hpp to the desired size

class Cube {
    public:
        static const unsigned int N = 3; // Size (Creates a 3x3x3)

and then recompile the project with make or an equivalent.

On Linux and macOS:

~/scramble-visualizer/build $ make

The visualizer should work for any positively sized cube within the memory constraints of your particular system.

Yes, that does mean you can have a trivial 1x1x1 Rubik's Cube:

Big Brain Cube

scramble-visualizer's People

Contributors

hueflux avatar

Stargazers

 avatar

scramble-visualizer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.