From 860393fb5bb5bf6d634c5e0722c7863d44e20928 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Tue, 17 Jan 2023 20:46:22 +0800 Subject: [PATCH] remove: some legacy code --- include/klotski.h => legacy/main.cc | 46 ++++++++--------- src-legacy/CMakeLists.txt | 7 --- src-legacy/main.cc | 79 ----------------------------- 3 files changed, 23 insertions(+), 109 deletions(-) rename include/klotski.h => legacy/main.cc (55%) delete mode 100644 src-legacy/CMakeLists.txt delete mode 100644 src-legacy/main.cc diff --git a/include/klotski.h b/legacy/main.cc similarity index 55% rename from include/klotski.h rename to legacy/main.cc index 8eb305d..14a817c 100644 --- a/include/klotski.h +++ b/legacy/main.cc @@ -1,26 +1,4 @@ -#ifndef _KLOTSKI_H_ -#define _KLOTSKI_H_ - -#include - -//#define B_space 0x0 -//#define B_fill 0x7 -//#define B_1x2 0x1 -//#define B_2x1 0x2 -//#define B_1x1 0x3 -//#define B_2x2 0x4 - -//#define C_1x1 uint64_t(0x3) -//#define C_1x2 uint64_t(0x39) -//#define C_2x1 uint64_t(0x7002) -//#define C_2x2 uint64_t(0x3F03C) -// -//#define F_1x1 uint64_t(0x7) -//#define F_1x2 uint64_t(0x3F) -//#define F_2x1 uint64_t(0x7007) -//#define F_2x2 uint64_t(0x3F03F) - -#endif +#include /* @@ -68,3 +46,25 @@ ====================================================== */ + +int main() { + printf("Klotski engine\n"); + + // 0x4FEA13400 + // # # # @ | 011 011 011 010 => 0100 1101 1011 -> 4DB + // * * & @ | 100 111 010 111 => 1110 1011 1100 -> EBC + // * * & $ | 111 111 111 010 => 0101 1111 1111 -> 5FF + // . + + $ | 000 001 111 111 => 1111 1100 1000 -> FC8 + // . # ~ ~ | 000 011 001 111 => 1110 0101 1000 -> E58 + // 0x0E58FC85FFEBC4DB + + // 0x1A9BF0C00 + // @ * * @ | 010 100 111 010 => 0101 1110 0010 -> 5E2 + // @ * * @ | 111 111 111 111 => 1111 1111 1111 -> FFF + // $ ~ ~ $ | 010 001 111 010 => 0101 1100 1010 -> 5CA + // $ # # $ | 111 011 011 111 => 1110 1101 1111 -> EDF + // # . . # | 011 000 000 011 => 0110 0000 0011 -> 603 + // 0x0603EDF5CAFFF5E2 + + return 0; +} diff --git a/src-legacy/CMakeLists.txt b/src-legacy/CMakeLists.txt deleted file mode 100644 index 0e513aa..0000000 --- a/src-legacy/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -set(CMAKE_CXX_STANDARD 14) - -include_directories(${PROJECT_SOURCE_DIR}/include) - -aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC) -add_executable(klotski ${SRC}) diff --git a/src-legacy/main.cc b/src-legacy/main.cc deleted file mode 100644 index ab1beb1..0000000 --- a/src-legacy/main.cc +++ /dev/null @@ -1,79 +0,0 @@ -//#include "case.h" -//#include "klotski.h" -#include -#include -#include -#include -#include - -//#define UP (-12) -//#define LEFT (-3) -//#define DOWN 12 -//#define DOWN_2 24 -//#define RIGHT 3 -//#define RIGHT_2 6 - -struct cache { - uint64_t code; - uint64_t filter; -}; -struct cache move_cache[16]; -int move_cache_num; - -struct klotski_info { - int step; - uint64_t code; - uint64_t filter; - std::list src; -}; - -std::queue cal_cache; -std::unordered_map klotski_case; - -int main() { - printf("Klotski engine\n"); - -// printf("%lx\n", compact_code(0x0E58FC85FFEBC4DB)); -// printf("%lx\n", compact_code(0x0603EDF5CAFFF5E2)); - -// graph_output(extract_code(0x4FEA13400)); -// printf("\n"); -// graph_output(extract_code(0x1A9BF0C00)); -// printf("\n"); - -// std::vector all_case; -// find_all_case(&all_case); -// printf("count -> %lu\n", all_case.size()); -// -// for (auto code : all_case) { -// if (code != compact_code(extract_code(code))) { -// printf("error -> %lx\n", code); -// } -// } - - // 0x4FEA13400 - // # # # @ | 011 011 011 010 => 0100 1101 1011 -> 4DB - // * * & @ | 100 111 010 111 => 1110 1011 1100 -> EBC - // * * & $ | 111 111 111 010 => 0101 1111 1111 -> 5FF - // . + + $ | 000 001 111 111 => 1111 1100 1000 -> FC8 - // . # ~ ~ | 000 011 001 111 => 1110 0101 1000 -> E58 - // 0x0E58FC85FFEBC4DB - - // 0x1A9BF0C00 - // @ * * @ | 010 100 111 010 => 0101 1110 0010 -> 5E2 - // @ * * @ | 111 111 111 111 => 1111 1111 1111 -> FFF - // $ ~ ~ $ | 010 001 111 010 => 0101 1100 1010 -> 5CA - // $ # # $ | 111 011 011 111 => 1110 1101 1111 -> EDF - // # . . # | 011 000 000 011 => 0110 0000 0011 -> 603 - // 0x0603EDF5CAFFF5E2 - - -// uint64_t code = 0x0603EDF5CAFFF5E2; - uint64_t code = 0x0E58FC85FFEBC4DB; - -// for (int i = 0; i < 100; ++i) { - cal_klotski(code); -// } - - return 0; -}