From b894fda2fcbfefba7af5bc18c6aa9a7b5b364928 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 17 Jan 2023 20:52:19 +0800 Subject: [PATCH] update: describe of raw code checker mask --- src/raw_code/raw_code.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/raw_code/raw_code.cc b/src/raw_code/raw_code.cc index 96946c4..cf7de9b 100644 --- a/src/raw_code/raw_code.cc +++ b/src/raw_code/raw_code.cc @@ -31,7 +31,6 @@ std::ostream& operator<<(std::ostream &out, const RawCode &self) { } std::string RawCode::dump_case() const { - // TODO: using stack char * std::string result; result.reserve(40); // 5 lines * ("x x x x\n") char dump_map[] = { @@ -51,7 +50,11 @@ std::string RawCode::dump_case() const { } bool RawCode::check(uint64_t raw_code) { // check whether raw code is valid - constexpr uint64_t MASK_1x1 = ~B_1x1 & 0b111; + /// MASK_1x2 MASK_2x1 MASK_2x2 + /// 000 100 000 000 000 000 000 000 000 100 000 000 + /// 000 000 000 000 100 000 000 000 100 100 000 000 + /// ... ... ... + constexpr uint64_t MASK_1x1 = ~B_1x1 & 0b111; /// 0b100 constexpr uint64_t MASK_1x2 = MASK_1x1 << 3; constexpr uint64_t MASK_2x1 = MASK_1x1 << 12; constexpr uint64_t MASK_2x2 = MASK_1x1 << 3 | MASK_1x1 << 12 | MASK_1x1 << 15;