mirror of https://github.com/dnomd343/klotski.git
Dnomd343
2 years ago
14 changed files with 45 additions and 44 deletions
@ -1,4 +1,4 @@ |
|||||
cmake_minimum_required(VERSION 3.0) |
cmake_minimum_required(VERSION 3.0) |
||||
|
|
||||
add_library(all_cases basic_ranges.cc all_cases.cc) |
add_library(all_cases all_cases.cc basic_ranges.cc) |
||||
target_link_libraries(all_cases common) |
target_link_libraries(all_cases utils) |
||||
|
@ -1,4 +0,0 @@ |
|||||
cmake_minimum_required(VERSION 3.0) |
|
||||
|
|
||||
add_library(common common.cc) |
|
||||
target_link_libraries(common short_code) |
|
@ -1,9 +0,0 @@ |
|||||
#pragma once |
|
||||
|
|
||||
#include <cstdint> |
|
||||
|
|
||||
class Common { |
|
||||
public: |
|
||||
static uint32_t range_reverse(uint32_t bin); |
|
||||
static bool check_case(uint32_t head, uint32_t range); |
|
||||
}; |
|
@ -1,4 +1,4 @@ |
|||||
cmake_minimum_required(VERSION 3.0) |
cmake_minimum_required(VERSION 3.0) |
||||
|
|
||||
add_library(common_code common_code.cc) |
add_library(common_code common_code.cc) |
||||
target_link_libraries(common_code common) |
target_link_libraries(common_code utils) |
||||
|
@ -1,4 +1,4 @@ |
|||||
cmake_minimum_required(VERSION 3.0) |
cmake_minimum_required(VERSION 3.0) |
||||
|
|
||||
add_library(raw_code raw_code.cc) |
add_library(raw_code raw_code.cc) |
||||
target_link_libraries(raw_code common common_code) |
target_link_libraries(raw_code utils common_code) |
||||
|
@ -1,4 +1,4 @@ |
|||||
cmake_minimum_required(VERSION 3.0) |
cmake_minimum_required(VERSION 3.0) |
||||
|
|
||||
add_library(short_code convert.cc short_code.cc data_loader.cc) |
add_library(short_code convert.cc short_code.cc data_loader.cc) |
||||
target_link_libraries(short_code common all_cases) |
target_link_libraries(short_code utils all_cases) |
||||
|
@ -0,0 +1,4 @@ |
|||||
|
cmake_minimum_required(VERSION 3.0) |
||||
|
|
||||
|
add_library(utils common.cc) |
||||
|
target_link_libraries(utils short_code) |
@ -0,0 +1,31 @@ |
|||||
|
#pragma once |
||||
|
|
||||
|
#include <cstdint> |
||||
|
|
||||
|
#define B_space 0b000 |
||||
|
#define B_fill 0b111 |
||||
|
#define B_1x2 0b001 |
||||
|
#define B_2x1 0b010 |
||||
|
#define B_1x1 0b011 |
||||
|
#define B_2x2 0b100 |
||||
|
|
||||
|
#define C_1x1 (uint64_t)0x3 // 011
|
||||
|
#define C_1x2 (uint64_t)0x39 // 111 001
|
||||
|
#define C_2x1 (uint64_t)0x7002 // 111 000 000 000 010
|
||||
|
#define C_2x2 (uint64_t)0x3F03C // 111 111 000 000 111 100
|
||||
|
|
||||
|
#define F_1x1 (uint64_t)0x7 // 111
|
||||
|
#define F_1x2 (uint64_t)0x3F // 111 111
|
||||
|
#define F_2x1 (uint64_t)0x7007 // 111 000 000 000 111
|
||||
|
#define F_2x2 (uint64_t)0x3F03F // 111 111 000 000 111 111
|
||||
|
|
||||
|
#define F_1x1_R (uint64_t)0x38 // 111 000
|
||||
|
#define F_1x1_D (uint64_t)0x7000 // 111 000 000 000 000
|
||||
|
#define F_2x1_R (uint64_t)0x38038 // 111 000 000 000 111 000
|
||||
|
#define F_1x2_D (uint64_t)0x3F000 // 111 111 000 000 000 000
|
||||
|
|
||||
|
class Common { |
||||
|
public: |
||||
|
static uint32_t range_reverse(uint32_t bin); |
||||
|
static bool check_case(uint32_t head, uint32_t range); |
||||
|
}; |
Loading…
Reference in new issue