aboutsummaryrefslogtreecommitdiff
path: root/test/060_transform/transform_tests.c
blob: 82694b2003a7bd7283caf084b3de88c7938d809c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "../test.h"

oriented_cube_t applytrans(oriented_cube_t, char *);

void run(void) {
	char cubestr[STRLENMAX], transtr[STRLENMAX];
	oriented_cube_t cube;

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

	cube = applytrans(cube, transtr);

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

Generated with cgit - Back to sebastiano.tronto.net