Browse Source

update: short code offset header

legacy
Dnomd343 2 years ago
parent
commit
35b501be6b
  1. 8
      src/klotski_core/short_code/offset/all_cases_offset.h
  2. 8
      src/klotski_core/short_code/offset/basic_ranges_offset.h
  3. 9
      src/klotski_core/short_code/offset/range_prefix_offset.h

8
src/klotski_core/short_code/offset/all_cases_offset.h

@ -1,12 +1,18 @@
#pragma once #pragma once
/// This is the head index, the offset (0 ~ 29334498) in all cases is obtained
/// according to the `head` (0 ~ 15). In other words, the short code range can be
/// obtained according to the position of the 2x2 block.
#include <cstdint> #include <cstdint>
namespace klotski { namespace klotski {
const uint32_t ALL_CASES_OFFSET[16] = { const uint32_t ALL_CASES_OFFSET[16] = {
0, 2942906, 5203298, 8146204, 0, 2942906, 5203298, 8146204,
8146204, 10468254, 12345199, 14667249, 8146204, 10468254, 12345199, 14667249,
14667249, 16989299, 18866244, 21188294, 14667249, 16989299, 18866244, 21188294,
21188294, 24131200, 26391592, 29334498, 21188294, 24131200, 26391592, 29334498,
}; };
}
} // namespace klotski

8
src/klotski_core/short_code/offset/basic_ranges_offset.h

@ -1,8 +1,13 @@
#pragma once #pragma once
/// This is the index for basic ranges, and its position (0 ~ 7311920) in all
/// basic ranges is located according to the first 12-bit (0 ~ 4095) of the
/// 32-bit `range`.
#include <cstdint> #include <cstdint>
namespace klotski { namespace klotski {
const uint32_t BASIC_RANGES_OFFSET[4096] = { const uint32_t BASIC_RANGES_OFFSET[4096] = {
0, 18272, 24960, 31648, 49920, 56608, 59056, 61504, 0, 18272, 24960, 31648, 49920, 56608, 59056, 61504,
68192, 74880, 77328, 79776, 86464, 104736, 111424, 118112, 68192, 74880, 77328, 79776, 86464, 104736, 111424, 118112,
@ -517,4 +522,5 @@ namespace klotski {
7189796, 7208068, 7214415, 7220762, 7238351, 7244698, 7246483, 7248268, 7189796, 7208068, 7214415, 7220762, 7238351, 7244698, 7246483, 7248268,
7253514, 7259861, 7261646, 7263431, 7268677, 7286266, 7291512, 7296758, 7253514, 7259861, 7261646, 7263431, 7268677, 7286266, 7291512, 7296758,
}; };
}
} // namespace klotski

9
src/klotski_core/short_code/offset/range_prefix_offset.h

@ -1,8 +1,14 @@
#pragma once #pragma once
/// This is the index for the range prefix. Given the `head` and the first
/// 12-bit (0 ~ 4095) of the `range`, you can get the positions of all cases
/// in the current `head`. That is, according to the position of 2x2 block
/// and the `range`, the short code range is obtained.
#include <cstdint> #include <cstdint>
namespace klotski { namespace klotski {
const uint32_t RANGE_PREFIX_OFFSET[16][4096] = {{ const uint32_t RANGE_PREFIX_OFFSET[16][4096] = {{
/// --------------------------------------------------------------------- 0x0 --------------------------------------------------------------------- /// --------------------------------------------------------------------- 0x0 ---------------------------------------------------------------------
0, 9527, 12991, 16067, 25594, 29058, 30527, 31657, 35121, 38525, 39766, 41041, 44445, 53972, 57436, 60512, 0, 9527, 12991, 16067, 25594, 29058, 30527, 31657, 35121, 38525, 39766, 41041, 44445, 53972, 57436, 60512,
@ -3108,4 +3114,5 @@ namespace klotski {
}, { }, {
/// --------------------------------------------------------------------- 0xF --------------------------------------------------------------------- /// --------------------------------------------------------------------- 0xF ---------------------------------------------------------------------
}}; }};
}
} // namespace klotski

Loading…
Cancel
Save