diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-10 14:44:48 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-10 14:44:48 +0100 |
| commit | fb9ae9e41eaf01b3651395fdd450ac1a4743e592 (patch) | |
| tree | 8fb29e9b62d40d6407f082f55a7164775154bf78 /test/050_transform | |
| parent | 04c3ee1f5acac47650be8d0ffbf90e238df0d12b (diff) | |
| download | nissy-core-fb9ae9e41eaf01b3651395fdd450ac1a4743e592.tar.gz nissy-core-fb9ae9e41eaf01b3651395fdd450ac1a4743e592.zip | |
Big changes to the interface
Diffstat (limited to 'test/050_transform')
| -rw-r--r-- | test/050_transform/transform_tests.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/test/050_transform/transform_tests.c b/test/050_transform/transform_tests.c index 30d62da..e22a4a1 100644 --- a/test/050_transform/transform_tests.c +++ b/test/050_transform/transform_tests.c | |||
| @@ -11,30 +11,22 @@ | |||
| 11 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
| 12 | 12 | ||
| 13 | int main() { | 13 | int main() { |
| 14 | char str[STRLENMAX]; | 14 | char cubestr[STRLENMAX], transtr[STRLENMAX]; |
| 15 | trans_t t; | ||
| 16 | cube_t cube; | 15 | cube_t cube; |
| 17 | 16 | ||
| 18 | fgets(str, STRLENMAX, stdin); | 17 | fgets(transtr, STRLENMAX, stdin); |
| 19 | t = readtrans(str); | 18 | fgets(cubestr, STRLENMAX, stdin); |
| 19 | cube = readcube("H48", cubestr); | ||
| 20 | 20 | ||
| 21 | if (t >= 48) { | 21 | cube = applytrans(cube, transtr); |
| 22 | printf("Error reading trans\n"); | ||
| 23 | return 1; | ||
| 24 | } | ||
| 25 | |||
| 26 | fgets(str, STRLENMAX, stdin); | ||
| 27 | cube = readcube(H48, str); | ||
| 28 | |||
| 29 | cube = transform(cube, t); | ||
| 30 | 22 | ||
| 31 | if (iserror(cube)) { | 23 | if (iserror(cube)) { |
| 32 | printf("Error transforming cube\n"); | 24 | printf("Error transforming cube\n"); |
| 33 | } else if (!issolvable(cube)) { | 25 | } else if (!issolvable(cube)) { |
| 34 | printf("Transformed cube is not solvable\n"); | 26 | printf("Transformed cube is not solvable\n"); |
| 35 | } else { | 27 | } else { |
| 36 | writecube(H48, cube, str); | 28 | writecube("H48", cube, cubestr); |
| 37 | printf("%s\n", str); | 29 | printf("%s\n", cubestr); |
| 38 | } | 30 | } |
| 39 | 31 | ||
| 40 | return 0; | 32 | return 0; |
