diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-04-13 17:15:42 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-04-13 17:15:42 +0200 |
| commit | ec87f96ffec31c430b6058663ae831c1b3a29ff9 (patch) | |
| tree | c6ffd8e37b9264dab331875c8b96839b05c3d9c0 /test/030_move/move_tests.c | |
| parent | a4598b740fe4b8350b7d09a575c793113c8fde2b (diff) | |
| download | cubecore-ec87f96ffec31c430b6058663ae831c1b3a29ff9.tar.gz cubecore-ec87f96ffec31c430b6058663ae831c1b3a29ff9.zip | |
Clean up
Diffstat (limited to 'test/030_move/move_tests.c')
| -rw-r--r-- | test/030_move/move_tests.c | 10 |
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 | ||
| 5 | int main(void) { | 5 | int 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"); |
