diff --git a/project_3x3_rubik_solver.cpp b/project_3x3_rubik_solver.cpp index f747b7a..9c54d39 100644 --- a/project_3x3_rubik_solver.cpp +++ b/project_3x3_rubik_solver.cpp @@ -110,7 +110,7 @@ enum Move { U, U_, D, D_, L, L_, R, R_, F, F_, B, B_ }; prototypes, then change the order of function definitions to match the order of prototypes */ void rotateFaceClockwise(array, N_ROWS>& face); -void rotateFaceCounterClockwise(array, N_ROWS>); +void rotateFaceCounterClockwise(array, N_ROWS>& face); bool isValidMove(const string& move); void applyMove(const string& move); void parseAndApplyMoves(const string& moves); @@ -376,7 +376,7 @@ void rotateFaceClockwise(array, N_ROWS>& face) { } -void rotateFaceCounterClockwise(array, N_ROWS> face) { +void rotateFaceCounterClockwise(array, N_ROWS>& face) { array, N_ROWS> temp; // Copy the original face @@ -396,6 +396,7 @@ void rotateFaceCounterClockwise(array, N_ROWS> face) { + void solveWhiteCross() { // Useful definitions typedef struct w_edge { @@ -666,11 +667,13 @@ void move_x(const bool PRIME) { void move_y(const bool PRIME) { // Y rotation rotates entire cube around y-axis - array> temp; + array, N_ROWS>, N_FACES> cube; if (!PRIME) { // Clockwise rotation of side faces for (size_t i = 0; i < N_COLS; i++) { + array temp; + temp[i] = cube[FRONT][0][i]; cube[FRONT][0][i] = cube[RIGHT][0][i]; cube[RIGHT][0][i] = cube[BACK][0][i];