(int idx)
| 109 | } |
| 110 | |
| 111 | void setct(int idx) { |
| 112 | parity = idx & 1; |
| 113 | idx >>>= 1; |
| 114 | int idxrl = rl2std[idx % 12]; |
| 115 | idx /= 12; |
| 116 | int r = 4; |
| 117 | for (int i = 7; i >= 0; i--) { |
| 118 | rl[i] = 0; |
| 119 | if (idxrl >= Cnk[i][r]) { |
| 120 | idxrl -= Cnk[i][r--]; |
| 121 | rl[i] = 1; |
| 122 | } |
| 123 | } |
| 124 | int idxfb = idx % 35; |
| 125 | idx /= 35; |
| 126 | r = 4; |
| 127 | fb[7] = 0; |
| 128 | for (int i = 6; i >= 0; i--) { |
| 129 | if (idxfb >= Cnk[i][r]) { |
| 130 | idxfb -= Cnk[i][r--]; |
| 131 | fb[i] = 1; |
| 132 | } else { |
| 133 | fb[i] = 0; |
| 134 | } |
| 135 | } |
| 136 | r = 4; |
| 137 | ud[7] = 0; |
| 138 | for (int i = 6; i >= 0; i--) { |
| 139 | if (idx >= Cnk[i][r]) { |
| 140 | idx -= Cnk[i][r--]; |
| 141 | ud[i] = 1; |
| 142 | } else { |
| 143 | ud[i] = 0; |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | void move(int i) { |
| 149 | parity ^= pmove[i]; |