From 72e018b066bd5cc3ce0181b43865a227e8b9b6ec Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 12 Apr 2024 20:22:01 +0200 Subject: Initial fork from H48 --- test/060_transform/transform_tests.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/060_transform/transform_tests.c (limited to 'test/060_transform/transform_tests.c') diff --git a/test/060_transform/transform_tests.c b/test/060_transform/transform_tests.c new file mode 100644 index 0000000..f95ad67 --- /dev/null +++ b/test/060_transform/transform_tests.c @@ -0,0 +1,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 (iserror(cube)) { + printf("Error transforming cube\n"); + } else if (!issolvable(cube)) { + printf("Transformed cube is not solvable\n"); + } else { + writecube("H48", cube, cubestr); + printf("%s\n", cubestr); + } + + return 0; +} -- cgit v1.3