From 7faca28009c5efb0ba2b897b34dbdcac47a1a6f3 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 25 Apr 2025 10:09:22 +0200 Subject: NISS --- test/030_applymoves/applymoves_tests.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/030_applymoves/applymoves_tests.c (limited to 'test/030_applymoves/applymoves_tests.c') diff --git a/test/030_applymoves/applymoves_tests.c b/test/030_applymoves/applymoves_tests.c new file mode 100644 index 0000000..98c9592 --- /dev/null +++ b/test/030_applymoves/applymoves_tests.c @@ -0,0 +1,23 @@ +#include "../test.h" + +oriented_cube_t applymoves(oriented_cube_t, char *); + +void run(void) { + char movestr[STRLENMAX], cubestr[STRLENMAX]; + oriented_cube_t cube; + + fgets(movestr, STRLENMAX, stdin); + fgets(cubestr, STRLENMAX, stdin); + cube = readcube(cubestr); + + cube = applymoves(cube, movestr); + + if (iserror(cube)) { + printf("Error moving cube\n"); + } else if (!issolvable(cube)) { + printf("Moved cube is not solvable\n"); + } else { + writecube(cube, NISSY_SIZE_CUBE, cubestr); + printf("%s\n", cubestr); + } +} -- cgit v1.3