aboutsummaryrefslogtreecommitdiff
path: root/test/060_transform/transform_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/060_transform/transform_tests.c')
-rw-r--r--test/060_transform/transform_tests.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/060_transform/transform_tests.c b/test/060_transform/transform_tests.c
new file mode 100644
index 0000000..c1bc5af
--- /dev/null
+++ b/test/060_transform/transform_tests.c
@@ -0,0 +1,25 @@
1#include "../test.h"
2
3cube_t applytrans(cube_t, char *);
4
5int main() {
6 char cubestr[STRLENMAX], transtr[STRLENMAX];
7 cube_t cube;
8
9 fgets(transtr, STRLENMAX, stdin);
10 fgets(cubestr, STRLENMAX, stdin);
11 cube = readcube("H48", cubestr);
12
13 cube = applytrans(cube, transtr);
14
15 if (iserror(cube)) {
16 printf("Error transforming cube\n");
17 } else if (!issolvable(cube)) {
18 printf("Transformed cube is not solvable\n");
19 } else {
20 writecube("H48", cube, cubestr);
21 printf("%s\n", cubestr);
22 }
23
24 return 0;
25}

Generated with cgit - Back to sebastiano.tronto.net