diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-15 09:30:23 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-15 09:30:23 +0200 |
| commit | ad1e483787cbc3aeb62c9afb9e31520df5a4b559 (patch) | |
| tree | 89ef2ed15791bfd227ac3c97f6669fd4c6cbf801 /cpp/examples | |
| parent | 6b3f40ac441fede250b9c381952fafd8aac28bd5 (diff) | |
| download | nissy-core-ad1e483787cbc3aeb62c9afb9e31520df5a4b559.tar.gz nissy-core-ad1e483787cbc3aeb62c9afb9e31520df5a4b559.zip | |
Simplified count_moves() in cpp api
Diffstat (limited to 'cpp/examples')
| -rw-r--r-- | cpp/examples/solve_h48h3k2.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/examples/solve_h48h3k2.cpp b/cpp/examples/solve_h48h3k2.cpp index 6639c55..b747976 100644 --- a/cpp/examples/solve_h48h3k2.cpp +++ b/cpp/examples/solve_h48h3k2.cpp | |||
| @@ -81,11 +81,14 @@ int main() { | |||
| 81 | return 1; | 81 | return 1; |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | if (solve_result.solutions.size() == 0) | 84 | if (solve_result.solutions.size() == 0) { |
| 85 | std::cout << "No solution found!" << std::endl; | 85 | std::cout << "No solution found!" << std::endl; |
| 86 | else | 86 | } else { |
| 87 | std::cout << "Solution: " << | 87 | auto& sol = solve_result.solutions[0]; |
| 88 | solve_result.solutions[0] << std::endl; | 88 | auto len = nissy::count_moves(sol).value; |
| 89 | std::cout << "Solution (" << len << " moves): " | ||
| 90 | << sol << std::endl; | ||
| 91 | } | ||
| 89 | 92 | ||
| 90 | return 0; | 93 | return 0; |
| 91 | } | 94 | } |
