diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-07 15:09:46 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-08-07 15:28:01 +0200 |
| commit | 5355de2921126e2b75e24abd57e17556e22a6ed0 (patch) | |
| tree | 0df679e152ffb2798248982ac58ff123c6859114 /cpp/examples | |
| parent | 57a7520545134ab95f7bb0397dcbe991c906a3e9 (diff) | |
| download | nissy-core-5355de2921126e2b75e24abd57e17556e22a6ed0.tar.gz nissy-core-5355de2921126e2b75e24abd57e17556e22a6ed0.zip | |
Added API function for solution variations
Diffstat (limited to '')
| -rw-r--r-- | cpp/examples/variations.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cpp/examples/variations.cpp b/cpp/examples/variations.cpp new file mode 100644 index 0000000..3c6421d --- /dev/null +++ b/cpp/examples/variations.cpp | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | /* A simple example showing how to move a cube and print it in H48 format. */ | ||
| 2 | |||
| 3 | #include "../nissy.h" | ||
| 4 | #include <iostream> | ||
| 5 | |||
| 6 | int main() { | ||
| 7 | std::string moves = "R U' Bw2 M D' x' F B(E2 F D B' Lw2 U2 U' S2 B)"; | ||
| 8 | auto v = std::get<nissy::variation>(nissy::variation::get("lastqt")); | ||
| 9 | auto variations = v.find_variations(moves).solutions; | ||
| 10 | |||
| 11 | std::cout << "Changing the last quarter turn of " << moves << " gives:" | ||
| 12 | << std::endl << variations; | ||
| 13 | |||
| 14 | return 0; | ||
| 15 | } | ||
