aboutsummaryrefslogtreecommitdiff
path: root/test/060_transform/transform_tests.c
blob: 8680a0b7610ced217b672ef861d4d4c2c69df040 (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
#include "../test.h"

cube_t applytrans(cube_t, char *);

int main(void) {
	char cubestr[STRLENMAX], transtr[STRLENMAX];
	cube_t cube;

	fgets(transtr, STRLENMAX, stdin);
	fgets(cubestr, STRLENMAX, stdin);
	cube = readcube("H48", cubestr);

	cube = applytrans(cube, transtr);

	if (cube_error(cube)) {
		printf("Error transforming cube\n");
	} else if (!cube_solvable(cube)) {
		printf("Transformed cube is not solvable\n");
	} else {
		writecube("H48", cube, cubestr);
		printf("%s\n", cubestr);
	}

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net