0

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.

TGrossb
  • 44
  • 6
  • 2
    Please read [ask] -- specifically, the part where you have to include a [mcve] that demonstrates the problem. Note that a "MCVE" is _not_ just a snippet of your code as-is. – Nic May 05 '17 at 01:32
  • Hope this helps. http://symbolaris.com/orbital/Orbital-doc/examples/Algorithms/RubiksCube.java – Srikanth May 05 '17 at 03:00
  • Isn't this what you look for. https://github.com/cs0x7f/min2phase – Amir Jan 05 '18 at 09:01

1 Answers1

1

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".

Nic
  • 6,211
  • 10
  • 46
  • 69
hyper-neutrino
  • 5,272
  • 2
  • 29
  • 50