| 166 | |
| 167 | template <Rule R> |
| 168 | constexpr std::tuple<int, int, int, int> countLine(const Line<R> &line) |
| 169 | { |
| 170 | constexpr auto Mid = LineLen<R> / 2; |
| 171 | |
| 172 | int realLen = 1, fullLen = 1; |
| 173 | int realLenInc = 1; |
| 174 | int start = Mid, end = Mid; |
| 175 | |
| 176 | for (int i = Mid - 1; i >= 0; i--) { |
| 177 | if (line[i] == SELF) |
| 178 | realLen += realLenInc; |
| 179 | else if (line[i] == OPPO) |
| 180 | break; |
| 181 | else |
| 182 | realLenInc = 0; |
| 183 | |
| 184 | fullLen++; |
| 185 | start = i; |
| 186 | } |
| 187 | |
| 188 | realLenInc = 1; |
| 189 | |
| 190 | for (int i = Mid + 1; i < LineLen<R>; i++) { |
| 191 | if (line[i] == SELF) |
| 192 | realLen += realLenInc; |
| 193 | else if (line[i] == OPPO) |
| 194 | break; |
| 195 | else |
| 196 | realLenInc = 0; |
| 197 | |
| 198 | fullLen++; |
| 199 | end = i; |
| 200 | } |
| 201 | |
| 202 | return std::make_tuple(realLen, fullLen, start, end); |
| 203 | } |
| 204 | |
| 205 | template <Rule R> |
| 206 | constexpr Line<R> shiftLine(const Line<R> &line, int i) |
nothing calls this directly
no outgoing calls
no test coverage detected