|
@ -16,17 +16,27 @@ std::queue<fast_cal_t*> cal_temp; |
|
|
|
|
|
|
|
|
void add_new_case(uint64_t code, uint64_t mask) { |
|
|
void add_new_case(uint64_t code, uint64_t mask) { |
|
|
|
|
|
|
|
|
|
|
|
// std::cout << RawCode(code).dump_case();
|
|
|
|
|
|
// std::cout << "~~~~~~~" << std::endl;
|
|
|
|
|
|
// auto temp_mask = mask;
|
|
|
|
|
|
// for (int n = 0; n < 20; ++n, temp_mask >>= 3) {
|
|
|
|
|
|
// std::cout << "+."[!(temp_mask & 0b111)] << " \n"[!(~n & 0b11)];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// std::cout << std::endl;
|
|
|
|
|
|
|
|
|
auto exist_case = cal_data.find(code); |
|
|
auto exist_case = cal_data.find(code); |
|
|
if (exist_case != cal_data.end()) { // find it
|
|
|
if (exist_case != cal_data.end()) { // find it
|
|
|
// mask update
|
|
|
|
|
|
|
|
|
exist_case->second.mask |= mask; // mask update
|
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// std::cout << RawCode(code).dump_case();
|
|
|
// std::cout << RawCode(code).dump_case();
|
|
|
// std::cout << "~~~~~~~" << std::endl;
|
|
|
// std::cout << "~~~~~~~" << std::endl;
|
|
|
// for (int n = 0; n < 20; ++n, mask >>= 3) {
|
|
|
// auto temp_mask = mask;
|
|
|
// std::cout << "+."[!(mask & 0b111)] << " \n"[!(~n & 0b11)];
|
|
|
// for (int n = 0; n < 20; ++n, temp_mask >>= 3) {
|
|
|
|
|
|
// std::cout << "+."[!(temp_mask & 0b111)] << " \n"[!(~n & 0b11)];
|
|
|
// }
|
|
|
// }
|
|
|
// std::cout << std::endl;
|
|
|
// std::cout << std::endl;
|
|
|
|
|
|
|
|
@ -45,7 +55,7 @@ void add_new_case(uint64_t code, uint64_t mask) { |
|
|
uint32_t fast_cal(uint64_t start_raw_code) { |
|
|
uint32_t fast_cal(uint64_t start_raw_code) { |
|
|
// std::cout << RawCode(start_raw_code).dump_case() << std::endl;
|
|
|
// std::cout << RawCode(start_raw_code).dump_case() << std::endl;
|
|
|
|
|
|
|
|
|
auto core = Core(); |
|
|
auto core = Core(add_new_case); |
|
|
|
|
|
|
|
|
cal_data.empty(); |
|
|
cal_data.empty(); |
|
|
|
|
|
|
|
@ -58,10 +68,23 @@ uint32_t fast_cal(uint64_t start_raw_code) { |
|
|
cal_temp.emplace(&cal_data[start_raw_code]); |
|
|
cal_temp.emplace(&cal_data[start_raw_code]); |
|
|
|
|
|
|
|
|
while (!cal_temp.empty()) { |
|
|
while (!cal_temp.empty()) { |
|
|
core.next_step(cal_temp.front()->code, add_new_case); |
|
|
|
|
|
|
|
|
if (((cal_temp.front()->code >> (3 * 0xD)) & 0b111) == B_2x2) { |
|
|
|
|
|
std::cout << "get resolve" << std::endl; |
|
|
|
|
|
std::cout << RawCode(cal_temp.front()->code).dump_case() << std::endl; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
core.next_step(cal_temp.front()->code, cal_temp.front()->mask); |
|
|
cal_temp.pop(); |
|
|
cal_temp.pop(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// core.next_step(cal_temp.front()->code, cal_temp.front()->mask);
|
|
|
|
|
|
// cal_temp.pop();
|
|
|
|
|
|
//
|
|
|
|
|
|
// core.next_step(cal_temp.front()->code, cal_temp.front()->mask);
|
|
|
|
|
|
// cal_temp.pop();
|
|
|
|
|
|
|
|
|
// std::cout << "size = " << cal_data.size() << std::endl;
|
|
|
// std::cout << "size = " << cal_data.size() << std::endl;
|
|
|
// std::cout << "queue size = " << cal_temp.size() << std::endl;
|
|
|
// std::cout << "queue size = " << cal_temp.size() << std::endl;
|
|
|
|
|
|
|
|
|