aboutsummaryrefslogtreecommitdiff
path: root/test/030_move/move_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/030_move/move_tests.c')
-rw-r--r--test/030_move/move_tests.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/030_move/move_tests.c b/test/030_move/move_tests.c
index 497ac6c..b940ecb 100644
--- a/test/030_move/move_tests.c
+++ b/test/030_move/move_tests.c
@@ -4,13 +4,21 @@ cube_t applymoves(cube_t, char *);
4 4
5int main(void) { 5int main(void) {
6 char movestr[STRLENMAX], cubestr[STRLENMAX]; 6 char movestr[STRLENMAX], cubestr[STRLENMAX];
7 int i, n;
8 move_t moves[STRLENMAX];
7 cube_t cube; 9 cube_t cube;
8 10
9 fgets(movestr, STRLENMAX, stdin); 11 fgets(movestr, STRLENMAX, stdin);
10 fgets(cubestr, STRLENMAX, stdin); 12 fgets(cubestr, STRLENMAX, stdin);
11 cube = cube_read("H48", cubestr); 13 cube = cube_read("H48", cubestr);
12 14
13 cube = applymoves(cube, movestr); 15 n = cube_readmoves(movestr, moves);
16
17 if (n == -1)
18 printf("Error reading moves!\n");
19
20 for (i = 0; i < n; i++)
21 cube = cube_move(cube, moves[i]);
14 22
15 if (cube_error(cube)) { 23 if (cube_error(cube)) {
16 printf("Error moving cube\n"); 24 printf("Error moving cube\n");

Generated with cgit - Back to sebastiano.tronto.net