From 43512399c21420966bd1e25a5810a2d78853048c Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sat, 7 Jan 2023 23:31:58 +0800 Subject: [PATCH] feat: demo of static AllCases --- CMakeLists.txt | 4 ++-- all_cases/CMakeLists.txt | 4 ++++ all_cases/all_cases.cc | 9 +++++++++ all_cases/all_cases.h | 12 ++++++++++++ all_cases/main.cc | 11 +++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 all_cases/CMakeLists.txt create mode 100644 all_cases/all_cases.cc create mode 100644 all_cases/all_cases.h create mode 100644 all_cases/main.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index b19eee3..7b8eac1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,5 +3,5 @@ set(CMAKE_CXX_STANDARD 14) project(klotski) #add_subdirectory(src) -#add_subdirectory(all_cases) -add_subdirectory(klotski) +add_subdirectory(all_cases) +#add_subdirectory(klotski) diff --git a/all_cases/CMakeLists.txt b/all_cases/CMakeLists.txt new file mode 100644 index 0000000..6929d98 --- /dev/null +++ b/all_cases/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.0) +set(CMAKE_CXX_STANDARD 14) + +add_executable(klotski main.cc all_cases.cc) diff --git a/all_cases/all_cases.cc b/all_cases/all_cases.cc new file mode 100644 index 0000000..1a25527 --- /dev/null +++ b/all_cases/all_cases.cc @@ -0,0 +1,9 @@ +#include "all_cases.h" + +std::vector AllCases::basic_ranges; + +void AllCases::build_basic_ranges() { + AllCases::basic_ranges.emplace_back(0); + AllCases::basic_ranges.emplace_back(1); + AllCases::basic_ranges.emplace_back(2); +} diff --git a/all_cases/all_cases.h b/all_cases/all_cases.h new file mode 100644 index 0000000..1a79187 --- /dev/null +++ b/all_cases/all_cases.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include + +class AllCases { +public: + static std::vector basic_ranges; + + static void build_basic_ranges(); + +}; diff --git a/all_cases/main.cc b/all_cases/main.cc new file mode 100644 index 0000000..5b31114 --- /dev/null +++ b/all_cases/main.cc @@ -0,0 +1,11 @@ +#include +#include "all_cases.h" + +int main() { + + std::cout << AllCases::basic_ranges.size() << std::endl; + AllCases::build_basic_ranges(); + std::cout << AllCases::basic_ranges.size() << std::endl; + + return 0; +}