(int first, int second)
| 102 | } |
| 103 | |
| 104 | private static void swap(int first, int second) { |
| 105 | if (first < 0 || second < 0 || first > 7 || second > 7 || first == second) { |
| 106 | return; |
| 107 | } |
| 108 | //位置交换 |
| 109 | int tmp = state[0][first]; |
| 110 | state[0][first] = state[0][second]; |
| 111 | state[0][second] = tmp; |
| 112 | //色相交换 |
| 113 | tmp = state[1][first]; |
| 114 | state[1][first] = state[1][second]; |
| 115 | state[1][second] = tmp; |
| 116 | } |
| 117 | |
| 118 | private static void twist(int corner, int value) { |
| 119 | if (value < 0) return; |