Browse Source

feat: demo of static AllCases

legacy
Dnomd343 2 years ago
parent
commit
43512399c2
  1. 4
      CMakeLists.txt
  2. 4
      all_cases/CMakeLists.txt
  3. 9
      all_cases/all_cases.cc
  4. 12
      all_cases/all_cases.h
  5. 11
      all_cases/main.cc

4
CMakeLists.txt

@ -3,5 +3,5 @@ set(CMAKE_CXX_STANDARD 14)
project(klotski) project(klotski)
#add_subdirectory(src) #add_subdirectory(src)
#add_subdirectory(all_cases) add_subdirectory(all_cases)
add_subdirectory(klotski) #add_subdirectory(klotski)

4
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)

9
all_cases/all_cases.cc

@ -0,0 +1,9 @@
#include "all_cases.h"
std::vector<uint32_t> 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);
}

12
all_cases/all_cases.h

@ -0,0 +1,12 @@
#pragma once
#include <vector>
#include <cstdint>
class AllCases {
public:
static std::vector<uint32_t> basic_ranges;
static void build_basic_ranges();
};

11
all_cases/main.cc

@ -0,0 +1,11 @@
#include <iostream>
#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;
}
Loading…
Cancel
Save