bool SolveTopCorners(ref List <string> path) { CubeInfo.Cubie cubie = null; List <CubeInfo.Cubie> topCornerCubes = _cubies.AnalyzeTopCorner(ref cubie, _solved); if (cubie == null) { return(true); // no work to do! } FocusCubie(cubie); _cubies.EnableColor(cubie, true); // case 1: no work to do -> no work to do, return // case 2: cube is in top row, but wrong pos or ori // case 3: cube is in middle row // case 4: cube is in bottom row if (cubie.state == (CubeInfo.POS | CubeInfo.ORI)) { _solved.Add(cubie); return(_solved.Count >= 8); // this hard-codes the order of steps (middle first => 4 cubes, corner next => 8 cubes) } if (cubie.level == CubeInfo.TOP) { return(SolveTopCorner_CaseTop(cubie, ref path)); } else { return(SolveTopCorner_CaseBottom(cubie, ref path)); } }