A C++ solver for the 2x2 cube.
First, you need to initialize the solver using(uses 180MB of RAM):
Solver2x2::init();
Or you can load from the memory usign(uses 31MB of RAM):
Solver2x2::loadFile("name.m2pc");
If the file does not exist, it will be created automatically. Event if the Solver is not initialized. Its suggested to use always the loadFile, because its faster after the first time.
Solver2x2::loadFile("sol.s2c");
std::cout << Solver2x2::solve("RYWOGBOROYWBBYOWYBGRRGGW") << std::endl;
This solver uses around 180 MB if you do not use the precomputed file, 30 if you use it. The initialization requires around 3 seconds on an AMD Ryzen 5 3500U. The solve (Solver2x2::solve) is immediatly instead, it is less than a millisecond.
cmake CMakeLists.txt
make
g++ -I include/ yourporgram.cpp -L. -lSolver2x2 -o yourporgram -Wl,-rpath,.