diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 10:40:49 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-19 10:40:49 +0100 |
| commit | 13275a4bb8696e730a4fffdd05b8e1d046e489c6 (patch) | |
| tree | 4db3ed3ada41158c451188c98e74fdde5ea296b2 /test/023_io_LST_write | |
| parent | d6fdf14d5c320bdca455f910d58d652c5a7827da (diff) | |
| download | nissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.tar.gz nissy-core-13275a4bb8696e730a4fffdd05b8e1d046e489c6.zip | |
Simplified cube definition for move and transformations even more
Diffstat (limited to 'test/023_io_LST_write')
| -rw-r--r-- | test/023_io_LST_write/01_solved.in | 1 | ||||
| -rw-r--r-- | test/023_io_LST_write/01_solved.out | 1 | ||||
| -rw-r--r-- | test/023_io_LST_write/02_scrambled.in | 1 | ||||
| -rw-r--r-- | test/023_io_LST_write/02_scrambled.out | 1 | ||||
| -rw-r--r-- | test/023_io_LST_write/io_LST_tests.c | 29 |
5 files changed, 33 insertions, 0 deletions
diff --git a/test/023_io_LST_write/01_solved.in b/test/023_io_LST_write/01_solved.in new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/023_io_LST_write/01_solved.in | |||
| @@ -0,0 +1 @@ | |||
| UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 | |||
diff --git a/test/023_io_LST_write/01_solved.out b/test/023_io_LST_write/01_solved.out new file mode 100644 index 0000000..c5b394b --- /dev/null +++ b/test/023_io_LST_write/01_solved.out | |||
| @@ -0,0 +1 @@ | |||
| 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 | |||
diff --git a/test/023_io_LST_write/02_scrambled.in b/test/023_io_LST_write/02_scrambled.in new file mode 100644 index 0000000..6a05bbc --- /dev/null +++ b/test/023_io_LST_write/02_scrambled.in | |||
| @@ -0,0 +1 @@ | |||
| FL0 DB0 UB1 FR0 UR0 DF0 UF0 BR1 UL1 BL1 DL0 DR0 DFR1 UFR1 UBR1 UFL2 DBR2 DFL0 DBL2 UBL0 | |||
diff --git a/test/023_io_LST_write/02_scrambled.out b/test/023_io_LST_write/02_scrambled.out new file mode 100644 index 0000000..9fcb603 --- /dev/null +++ b/test/023_io_LST_write/02_scrambled.out | |||
| @@ -0,0 +1 @@ | |||
| 38, 32, 37, 68, 67, 2, 71, 1, 9, 2, 17, 8, 4, 3, 0, 27, 21, 26, 6, 7 | |||
diff --git a/test/023_io_LST_write/io_LST_tests.c b/test/023_io_LST_write/io_LST_tests.c new file mode 100644 index 0000000..1532f91 --- /dev/null +++ b/test/023_io_LST_write/io_LST_tests.c | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | #define STRLENMAX 10000 | ||
| 4 | |||
| 5 | bool iserror(cube_t); | ||
| 6 | bool issolvable(cube_t); | ||
| 7 | cube_t readcube(char *, char *); | ||
| 8 | void writecube(char *, cube_t, char *); | ||
| 9 | |||
| 10 | int main() { | ||
| 11 | char *c, str[STRLENMAX]; | ||
| 12 | cube_t cube; | ||
| 13 | |||
| 14 | for (c = str; (*c = getchar()) != EOF; c++) ; | ||
| 15 | *c = '\0'; | ||
| 16 | |||
| 17 | cube = readcube("H48", str); | ||
| 18 | |||
| 19 | if (iserror(cube)) { | ||
| 20 | printf("Error reading cube\n"); | ||
| 21 | } else if (!issolvable(cube)) { | ||
| 22 | printf("Cube is not solvable\n"); | ||
| 23 | } else { | ||
| 24 | writecube("LST", cube, str); | ||
| 25 | printf("%s\n", str); | ||
| 26 | } | ||
| 27 | |||
| 28 | return 0; | ||
| 29 | } | ||
