Browse Source

feat: add `TYPE_ID_GROUP_NUM`

legacy
Dnomd343 2 years ago
parent
commit
f818787c5e
  1. 12
      src/klotski_core/ffi/tmain.cc
  2. 16
      src/klotski_core/group/type_id.h

12
src/klotski_core/ffi/tmain.cc

@ -33,17 +33,17 @@ using klotski::TYPE_ID_LIMIT;
void tmain() { void tmain() {
// printf("tmain start\n"); // printf("tmain start\n");
std::vector<uint32_t> type_id_size; std::vector<uint32_t> group_num;
type_id_size.reserve(TYPE_ID_LIMIT); group_num.reserve(TYPE_ID_LIMIT);
for (uint32_t type_id = 0; type_id < TYPE_ID_LIMIT; ++type_id) { for (uint32_t type_id = 0; type_id < TYPE_ID_LIMIT; ++type_id) {
type_id_size.emplace_back(Group::all_cases(type_id).size()); group_num.emplace_back(Group::build_groups(type_id).size());
std::cerr << type_id << std::endl; std::cerr << type_id << std::endl;
} }
for (uint32_t i = 0; i < type_id_size.size(); ++i) { for (uint32_t i = 0; i < group_num.size(); ++i) {
printf("%6d, ", type_id_size[i]); printf("%4d, ", group_num[i]);
if (i % 12 == 11) { if (i % 16 == 15) {
printf("\n"); printf("\n");
} }

16
src/klotski_core/group/type_id.h

@ -58,6 +58,20 @@ const uint32_t TYPE_ID_MAX_GROUP_SIZE[203] = {
1532, 45, 66, 38, 44, 5, 82, 21, 23, 24, 21, 1532, 45, 66, 38, 44, 5, 82, 21, 23, 24, 21,
}; };
// TODO: TYPE_ID_GROUP_NUM const uint16_t TYPE_ID_GROUP_NUM[203] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1,
1, 1, 3, 79, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21, 141, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1,
1, 17, 273, 1, 1, 1, 1, 1, 1, 9, 145, 841, 1, 1, 1, 1,
1, 1, 15, 97, 517, 1, 1, 1, 1, 1, 1, 1, 5, 91, 1, 1,
1, 1, 1, 59, 587, 1, 1, 1, 1, 21, 353, 1741, 1, 1, 1, 7,
81, 479, 2327, 1, 1, 1, 5, 33, 165, 1053, 1, 1, 1, 1, 1, 9,
157, 1, 1, 1, 57, 505, 1, 1, 13, 325, 1729, 3, 9, 99, 631, 2609,
1, 17, 91, 487, 2653, 1, 1, 11, 75, 898, 2, 2, 2, 2, 80, 1,
2, 138, 14, 126, 590, 22, 183, 1074, 33, 209, 1178, 13, 171, 1185, 6, 16,
214, 6, 18, 54, 2, 44, 40, 124, 84, 70, 18,
};
} // namespace klotski } // namespace klotski

Loading…
Cancel
Save