aboutsummaryrefslogtreecommitdiff
path: root/test/040_inverse_cube/inverse_tests.c
blob: 59ce84ea69c6643641c97060d7620627a04acfa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "../test.h"

int main(void) {
	char str[STRLENMAX];
	cube_t cube, inv;

	fgets(str, STRLENMAX, stdin);
	cube = cube_read("H48", str);
	inv = cube_inverse(cube);

	if (cube_error(inv)) {
		printf("Error inverting cube\n");
	} else if (!cube_solvable(inv)) {
		printf("Inverted cube is not solvable\n");
	} else {
		cube_write("H48", inv, str);
		printf("%s\n", str);
	}

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net