From f818787c5e9127ed43709ecb2c1b904b2b4b956b Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 13 Apr 2023 20:26:45 +0800 Subject: [PATCH] feat: add `TYPE_ID_GROUP_NUM` --- src/klotski_core/ffi/tmain.cc | 12 ++++++------ src/klotski_core/group/type_id.h | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/klotski_core/ffi/tmain.cc b/src/klotski_core/ffi/tmain.cc index 472934f..32c8501 100644 --- a/src/klotski_core/ffi/tmain.cc +++ b/src/klotski_core/ffi/tmain.cc @@ -33,17 +33,17 @@ using klotski::TYPE_ID_LIMIT; void tmain() { // printf("tmain start\n"); - std::vector type_id_size; - type_id_size.reserve(TYPE_ID_LIMIT); + std::vector group_num; + group_num.reserve(TYPE_ID_LIMIT); 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; } - 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]); - if (i % 12 == 11) { + printf("%4d, ", group_num[i]); + if (i % 16 == 15) { printf("\n"); } diff --git a/src/klotski_core/group/type_id.h b/src/klotski_core/group/type_id.h index ac5d4ec..8b558e9 100644 --- a/src/klotski_core/group/type_id.h +++ b/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, }; -// 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