aboutsummaryrefslogtreecommitdiff
path: root/example/example.cpp
blob: 3fa7d6606bcc366e53e469d2083f96ce6b2bc3e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <cinttypes>
#include <iostream>
#include <vector>

extern "C" {
#include "../cube.h"
}

cube_t apply_alg(cube_t cube, std::vector<move_t>& moves) {
	auto ret {cube};

	for (auto m : moves)
		ret = cube_move(ret, m);

	return ret;
}

int main() {
	auto cube {cube_new()};
	std::vector<move_t> moves { R, U, R3, U3 };
	char cstr[500];

	std::cout << "The solved cube looks like this in H48 notation:\n";
	cube_write("H48", cube, cstr);
	std::string solvedstr(cstr);
	std::cout << solvedstr << "\n";
	std::cout << "After a sexy move it looks like this:\n";
	cube = apply_alg(cube, moves);
	cube_write("H48", cube, cstr);
	std::string sexystr(cstr);
	std::cout << sexystr << "\n";
	
	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net