1
Fork 0
This repository has been archived on 2025-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
puzzle-wuzzle-generator/main.cpp
2014-02-04 20:00:21 +01:00

54 lines
1.2 KiB
C++

#include "field.hpp"
#include "clusters.hpp"
#include "solver.hpp"
#include <iostream>
#include <chrono>
#include <thread>
template <typename Field>
auto is_void(Field const & field){
for(auto&& p : field.all_positions()){
if(!field.empty(p)) return false;
}
return true;
}
int main(){
using namespace std;
// constexpr auto W = 10;
// constexpr auto H = 10;
// auto field = create_rectangular_field<W, H>({
// 2, 1, 1, 1, 2, 1, 2, 4, 1, 2,
// 2, 2, 2, 1, 2, 2, 1, 1, 1, 2,
// 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
// 2, 1, 1, 4, 2, 4, 2, 1, 2, 1,
// 1, 1, 1, 3, 2, 2, 2, 3, 3, 4,
// 3, 2, 2, 1, 1, 1, 2, 2, 2, 2,
// 1, 1, 2, 1, 3, 1, 1, 4, 2, 3,
// 1, 1, 1, 1, 3, 1, 3, 2, 1, 2,
// 1, 1, 1, 1, 2, 4, 1, 3, 1, 2,
// 1, 1, 1, 1, 2, 2, 1, 1, 4, 9
// });
constexpr auto W = 9;
constexpr auto H = 9;
auto field = create_rectangular_field<W, H>({
2, 1, 1, 1, 2, 1, 2, 4, 1,
2, 2, 2, 1, 2, 2, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 2, 2,
2, 1, 1, 4, 2, 4, 2, 1, 2,
1, 1, 1, 3, 2, 2, 2, 3, 3,
3, 2, 2, 1, 1, 1, 2, 2, 2,
1, 1, 2, 1, 3, 1, 1, 4, 2,
1, 1, 1, 1, 3, 1, 3, 2, 1,
1, 1, 1, 1, 2, 4, 1, 3, 9
});
field.print(std::cout);
cout << solve(field) << std::endl;
}