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/include/solver.hpp

19 lines
366 B
C++

#pragma once
#include "clusters.hpp"
template <typename Field>
auto solve(Field const & field){
for(auto&& p : field.all_positions()){
if(!field.empty(p)) goto analyse;
}
return true;
analyse:
for(auto&& c : all_clusters(field)){
if(c.size() < 2) continue;
auto new_field = make_empty(field, c);
if(solve(new_field)) return true;
}
return false;
}