MCPcopy Create free account
hub / github.com/MeigenChou/DCTimer-Android / idxToOri

Method idxToOri

app/src/main/java/solver/Utils.java:174–184  ·  view source on GitHub ↗
(int[] orientation, int index, int length, boolean zeroSum)

Source from the content-addressed store, hash-verified

172 }
173
174 public static void idxToOri(int[] orientation, int index, int length, boolean zeroSum) {
175 int sum = 0;
176 int start = zeroSum ? length - 2 : length - 1;
177 for (int i = start; i >= 0; i--) {
178 orientation[i] = index % 3;
179 index /= 3;
180 sum += orientation[i];
181 }
182 if (zeroSum)
183 orientation[length - 1] = 3 - sum % 3;
184 }
185
186 // combinations
187 public static int combToIdx(int[] comb, int k, int n) {

Callers 13

initMethod · 0.95
scrambleL2LMethod · 0.95
GearClass · 0.95
CubeRUClass · 0.95
gettwsmvMethod · 0.95
randomEGMethod · 0.95
randomTEGMethod · 0.95
scrambleNobarMethod · 0.95
getmvMethod · 0.95
initMethod · 0.95
initMethod · 0.95
SkewbFCNClass · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected