Browse Source

feat: add group seeds index

legacy
Dnomd343 2 years ago
parent
commit
ddcf24c137
  1. 13
      src/klotski_core/ffi/tmain.cc
  2. 2
      src/klotski_core/group/group.cc
  3. 1599
      src/klotski_core/group/index.h

13
src/klotski_core/ffi/tmain.cc

@ -72,6 +72,7 @@ void tmain() {
// std::cout << tmp << std::endl; // std::cout << tmp << std::endl;
// } // }
std::vector<uint32_t> group_id_index;
for (uint16_t type_id = 0; type_id < TYPE_ID_LIMIT; ++type_id) { for (uint16_t type_id = 0; type_id < TYPE_ID_LIMIT; ++type_id) {
auto groups = Group::build_groups(type_id); auto groups = Group::build_groups(type_id);
std::map<CommonCode, uint32_t> seeds; std::map<CommonCode, uint32_t> seeds;
@ -84,13 +85,23 @@ void tmain() {
for (auto &&tmp: seeds) { for (auto &&tmp: seeds) {
// std::cout << tmp.first << " -> " << tmp.second << std::endl; // std::cout << tmp.first << " -> " << tmp.second << std::endl;
std::cout << tmp.first << std::endl; // std::cout << tmp.first << std::endl;
// std::cout << tmp.second << std::endl;
group_id_index.emplace_back(tmp.second);
} }
std::cerr << type_id << std::endl; std::cerr << type_id << std::endl;
} }
printf(" ");
for (uint32_t i = 0; i < group_id_index.size(); ++i) {
printf("%4d, ", group_id_index[i]);
if (i % 16 == 15) {
printf("\n ");
}
}
printf("\n");
// printf("tmain exit\n"); // printf("tmain exit\n");
} }

2
src/klotski_core/group/group.cc

@ -9,6 +9,8 @@
#include "seeds.h" #include "seeds.h"
#include "index.h"
namespace klotski { namespace klotski {
using klotski::AllCases; using klotski::AllCases;

1599
src/klotski_core/group/index.h

File diff suppressed because it is too large
Loading…
Cancel
Save