aboutsummaryrefslogtreecommitdiff
path: root/test/030_applymoves/applymoves_tests.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-25 10:09:22 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-25 10:09:22 +0200
commit7faca28009c5efb0ba2b897b34dbdcac47a1a6f3 (patch)
treefd507509d00d2926175c72f4c06b9158c3a331a7 /test/030_applymoves/applymoves_tests.c
parent17e5a9e1e2b241c67956651f87f40236467fe7d8 (diff)
downloadnissy-core-7faca28009c5efb0ba2b897b34dbdcac47a1a6f3.tar.gz
nissy-core-7faca28009c5efb0ba2b897b34dbdcac47a1a6f3.zip
NISS
Diffstat (limited to 'test/030_applymoves/applymoves_tests.c')
-rw-r--r--test/030_applymoves/applymoves_tests.c23
1 files changed, 23 insertions, 0 deletions
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 @@
1#include "../test.h"
2
3oriented_cube_t applymoves(oriented_cube_t, char *);
4
5void run(void) {
6 char movestr[STRLENMAX], cubestr[STRLENMAX];
7 oriented_cube_t cube;
8
9 fgets(movestr, STRLENMAX, stdin);
10 fgets(cubestr, STRLENMAX, stdin);
11 cube = readcube(cubestr);
12
13 cube = applymoves(cube, movestr);
14
15 if (iserror(cube)) {
16 printf("Error moving cube\n");
17 } else if (!issolvable(cube)) {
18 printf("Moved cube is not solvable\n");
19 } else {
20 writecube(cube, NISSY_SIZE_CUBE, cubestr);
21 printf("%s\n", cubestr);
22 }
23}

Generated with cgit - Back to sebastiano.tronto.net