From ec87f96ffec31c430b6058663ae831c1b3a29ff9 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 13 Apr 2024 17:15:42 +0200 Subject: Clean up --- test/030_move/move_tests.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/030_move') 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 *); int main(void) { char movestr[STRLENMAX], cubestr[STRLENMAX]; + int i, n; + move_t moves[STRLENMAX]; cube_t cube; fgets(movestr, STRLENMAX, stdin); fgets(cubestr, STRLENMAX, stdin); cube = cube_read("H48", cubestr); - cube = applymoves(cube, movestr); + n = cube_readmoves(movestr, moves); + + if (n == -1) + printf("Error reading moves!\n"); + + for (i = 0; i < n; i++) + cube = cube_move(cube, moves[i]); if (cube_error(cube)) { printf("Error moving cube\n"); -- cgit v1.3