aboutsummaryrefslogtreecommitdiff
path: root/test/060_transform/transform_tests.c
blob: 454bc2253164d3c859eea0f64869491a695e80bc (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 = cube_read("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 {
		cube_write("H48", cube, cubestr);
		printf("%s\n", cubestr);
	}

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net