Browse Source

fix: search max step in case list

master
Dnomd343 2 years ago
parent
commit
6372a3a875
  1. 10
      src/analyse/analyse.cc
  2. 16
      src/main.cc

10
src/analyse/analyse.cc

@ -64,7 +64,15 @@ void Analyse::backtrack(const std::vector<uint64_t> &raw_code_list) {
/// layer init
// auto max_step = cases[code].step; // TODO: update max step cal
// auto max_step = 81;
auto max_step = 14; // TODO: search max_step value
uint32_t max_step = 0;
for (const auto &code : raw_code_list) {
// TODO: check whether cases include code
if (cases[code].step > max_step) {
max_step = cases[code].step;
}
}
layer_data.resize(max_step + 1);
/// init track begin cases

16
src/main.cc

@ -212,14 +212,18 @@ int main() {
// };
// a.backtrack(raw_codes);
// std::vector<uint64_t> raw_codes = {
// CommonCode("DE77D80").to_raw_code().unwrap(),
// CommonCode("DF6DD80").to_raw_code().unwrap(),
// CommonCode("DF69730").to_raw_code().unwrap(),
// CommonCode("DE76D30").to_raw_code().unwrap(),
// CommonCode("D5AF730").to_raw_code().unwrap(),
// CommonCode("D5B43BC").to_raw_code().unwrap(),
// };
std::vector<uint64_t> raw_codes = {
CommonCode("DE77D80").to_raw_code().unwrap(),
CommonCode("DF6DD80").to_raw_code().unwrap(),
CommonCode("DF69730").to_raw_code().unwrap(),
CommonCode("DE76D30").to_raw_code().unwrap(),
CommonCode("D5AF730").to_raw_code().unwrap(),
CommonCode("D5B43BC").to_raw_code().unwrap(),
CommonCode("EF697C0").to_raw_code().unwrap(),
};
// TODO: FATAL ERROR -> don't using mask in Analyse
a.backtrack(raw_codes);

Loading…
Cancel
Save