Reputation: 44
I am, as the title says, writing a method of solving a Rubik's cube in java, and I am running into some difficulties. I am trying to implement Kociemba's Algorithm and to do this I am following an article from here (the specific part is about 2/3 of the way down by the way). However, the code has an if statement with the conditional subgoal reached
. I don't understand how I can check this, because the subgoals are not really defined. So, if someone could explain to me how I could check if the cube has reached the subgoal or provide some other tutorial, I would be very grateful. Thank you in advance for your help.
Upvotes: 0
Views: 1473
Reputation: 5425
This does not really have anything to do with Java specifically. I will explain what a subgoal is. Essentially, to complete the cube, you want to convert it into a specific state. This is the endgoal. A subgoal is an intermediate state that you want to achieve. I'm assuming you know how to solve a Rubik's Cube. With a fully scrambled state, a subgoal might be to get all of the white edge pieces into place. So, you keep looping a phase until you have reached this subgoal, and then you start the next phase, which could be something like "place all of the white corners into the right place".
Upvotes: 1