You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 16, 2023. It is now read-only.
Rubik's Cube via visualization using OpenGL and GLUT
Language: C++
OS: macOS
Requires frameworks OpenGL and GLUT (recommend to use XCode or AppCode with included frameworks)
Average amount of rotates for cube solving is 150-200
Some info about code:
To edit rotation speed you need to change ROTATE_SPEED_STEP in Cube/CubeSettings.h from 15 by a number, which is correct for (ROTATE_SPEED_STEP*x + ROTATE_START_VALUE) % 90 == 0, where x - is a natural number
You need to write the unfolding of the cube in input.txt in the strict order of planes: Up -> Left -> Front -> Right -> Back -> Bottom
If you want to put words "orange", "white" etc. instead of "O", "W" etc. in input, you need to change maxWordSize in Other/HelpingFunctions.h from 1 to 6 and uncomment respectively code string in PrintRubikCube() (it's marked)
Function CheckIfCubeCorrect() evaluating the correctly of centers and if they are wrong, it throws an exception once you'll click Find Solution
You can rotate planes in a window using keys 1, 2, 3, 4, 5, 6 for Up, Left, Front, Right, Back, Bottom plane respectively
Using keys up_arrow, left_arrow, down_arrow, right_arrow rotates cube by X and Y coordinates
"Solve cube using only right (left) and up rotates" works only with a solved cube
cout <<" \ b "; in code cleans up 1 symbol from the console - if you'll try to refactor smth, you need to know it
If you want code to show you solving time, you need to uncomment // Timer SolvingTime;, but be careful: it could crash all code if nothing used before "Cube-solver-MachineGun"
An example of output for solving 10 millions cubes
You can read one cube's unfolding from input once, at the second time it'll read the next symbols from the file (nothing)
If the cube's unfolding is incorrect and you'll try to find a solution, the cube will start to rotate it planes, but after a huge amount of useless tryings of solving it'll write that cube is incorrect (no other way to prove that cube can't be solved)
About
Rubiks cube solver written on c++ with OpenGL and GLUT