diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-22 09:00:15 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-04-22 09:00:15 +0200 |
| commit | 8b72e391c7185e3da0dfbf0ab60068ac37e4d5cc (patch) | |
| tree | b79d8154f16a0dadd8d8265d32b8bd95e96263aa /cpp/examples/move.cpp | |
| parent | 510a7471348788fccba6b7c4b9f7b7cc9aee6ba9 (diff) | |
| download | nissy-core-8b72e391c7185e3da0dfbf0ab60068ac37e4d5cc.tar.gz nissy-core-8b72e391c7185e3da0dfbf0ab60068ac37e4d5cc.zip | |
Removed old scripts and updated public API
Diffstat (limited to 'cpp/examples/move.cpp')
| -rw-r--r-- | cpp/examples/move.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cpp/examples/move.cpp b/cpp/examples/move.cpp new file mode 100644 index 0000000..970a65d --- /dev/null +++ b/cpp/examples/move.cpp | |||
| @@ -0,0 +1,17 @@ | |||
| 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 | nissy::cube c; | ||
| 8 | if (!c.move("R' U' F").ok()) { | ||
| 9 | std::cout << "Error moving the cube!" << std::endl; | ||
| 10 | return 1; | ||
| 11 | } | ||
| 12 | |||
| 13 | auto str = c.to_string(); | ||
| 14 | std::cout << "Cube after R' U' F:" << std::endl << str << std::endl; | ||
| 15 | |||
| 16 | return 0; | ||
| 17 | } | ||
