aboutsummaryrefslogtreecommitdiff
path: root/test/040_inverse_cube/inverse_tests.c
blob: 4cb7ad1ae96f058d67b688022d176cda1670b73b (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"

cube_t inverse(cube_t);

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

	fgets(str, STRLENMAX, stdin);
	cube = readcube("H48", str);
	inv = inverse(cube);

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

Generated with cgit - Back to sebastiano.tronto.net