diff options
Diffstat (limited to 'cpp/examples')
| -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 | } | ||
