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

Method getParity

app/src/main/java/cs/sq12phase/FullCube.java:129–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127 int[] arr = new int[16];
128
129 int getParity() {
130// int[] arr = new int[16];
131 int cnt = 0;
132 arr[0] = pieceAt(0);
133 for (int i = 1; i < 24; i++) {
134 if (pieceAt(i) != arr[cnt]) {
135 arr[++cnt] = pieceAt(i);
136 }
137 }
138 int p = 0;
139 for (int a = 0; a < 16; a++) {
140 for (int b = a + 1 ; b < 16; b++) {
141 if (arr[a] > arr[b]) p ^= 1;
142 }
143 }
144 return p;
145 }
146
147 int getShapeIdx() {
148 int urx = ur & 0x111111;

Callers 1

getShapeIdxMethod · 0.95

Calls 1

pieceAtMethod · 0.95

Tested by

no test coverage detected