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/030_move/move_tests.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/030_move/move_tests.c (limited to 'test/030_move/move_tests.c') diff --git a/test/030_move/move_tests.c b/test/030_move/move_tests.c new file mode 100644 index 0000000..73e9dbe --- /dev/null +++ b/test/030_move/move_tests.c @@ -0,0 +1,25 @@ +#include "../test.h" + +cube_t applymoves(cube_t, char *); + +int main(void) { + char movestr[STRLENMAX], cubestr[STRLENMAX]; + cube_t cube; + + fgets(movestr, STRLENMAX, stdin); + fgets(cubestr, STRLENMAX, stdin); + cube = readcube("H48", 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("H48", cube, cubestr); + printf("%s\n", cubestr); + } + + return 0; +} -- cgit v1.3