diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-04 18:36:31 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-05-04 18:36:31 +0200 |
| commit | 98dfdfc2aaa92bacdc94fedc433931cb3ea66a0a (patch) | |
| tree | ed542c3128e379aa221a71a0bea107d2cb5b32c6 /example/example.cpp | |
| parent | ba4e25810e0b845fe0488bc504bf3ab5bd1f3824 (diff) | |
| download | cubecore-98dfdfc2aaa92bacdc94fedc433931cb3ea66a0a.tar.gz cubecore-98dfdfc2aaa92bacdc94fedc433931cb3ea66a0a.zip | |
Added .gitignore; C++ example clean up; example compile script clean up
Diffstat (limited to '')
| -rw-r--r-- | example/example.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/example/example.cpp b/example/example.cpp index c7ec982..3fa7d66 100644 --- a/example/example.cpp +++ b/example/example.cpp | |||
| @@ -6,18 +6,18 @@ extern "C" { | |||
| 6 | #include "../cube.h" | 6 | #include "../cube.h" |
| 7 | } | 7 | } |
| 8 | 8 | ||
| 9 | cube_t apply_alg(cube_t cube, std::vector<move_t> *moves) { | 9 | cube_t apply_alg(cube_t cube, std::vector<move_t>& moves) { |
| 10 | auto ret = cube; | 10 | auto ret {cube}; |
| 11 | 11 | ||
| 12 | for (auto m : *moves) | 12 | for (auto m : moves) |
| 13 | ret = cube_move(ret, m); | 13 | ret = cube_move(ret, m); |
| 14 | 14 | ||
| 15 | return ret; | 15 | return ret; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | int main() { | 18 | int main() { |
| 19 | auto cube = cube_new(); | 19 | auto cube {cube_new()}; |
| 20 | auto moves = new std::vector<move_t> { R, U, R3, U3 }; | 20 | std::vector<move_t> moves { R, U, R3, U3 }; |
| 21 | char cstr[500]; | 21 | char cstr[500]; |
| 22 | 22 | ||
| 23 | std::cout << "The solved cube looks like this in H48 notation:\n"; | 23 | std::cout << "The solved cube looks like this in H48 notation:\n"; |
