(int shape, int d, int lm)
| 193 | } |
| 194 | |
| 195 | private static boolean searchTws(int shape, int d, int lm) { |
| 196 | if (d == 0) return shape == solved; //prunTws[getShape2Idx(shape)] == 0; |
| 197 | if (prunTws[getShape2Idx(shape)] > d) return false; |
| 198 | //top move |
| 199 | for (int i = 0; i < 12; i++) { |
| 200 | if (i != 0) sol[sollen++] = i; |
| 201 | //bottom move |
| 202 | for (int j = 0; j < 12; j++) { |
| 203 | if (j != 0) sol[sollen++] = -j; |
| 204 | //twist |
| 205 | if ((lm != 0 || (i != 0 || j != 0)) && canTwist(shape)) { |
| 206 | int next = twist(shape); |
| 207 | sol[sollen++] = 0; |
| 208 | if (searchTws(next, d-1, 0)) { |
| 209 | return true; |
| 210 | } |
| 211 | sollen--; |
| 212 | } |
| 213 | if (j != 0) sollen--; |
| 214 | shape = rotateBottom(shape); |
| 215 | } |
| 216 | if (i != 0) sollen--; |
| 217 | shape = rotateTop(shape); |
| 218 | } |
| 219 | return false; |
| 220 | } |
| 221 | |
| 222 | private static String move2string() { |
| 223 | StringBuilder sb = new StringBuilder("\n\nttm: "); |
no test coverage detected