io_LST_read_tests.c (406B)
1 #include "../test.h" 2 3 void run(void) { 4 char str[STRLENMAX], *aux; 5 cube_t cube; 6 7 aux = str; 8 while (fgets(aux, STRLENMAX, stdin) != NULL) 9 while (*aux != '\n') 10 aux++; 11 12 cube = readcube("LST", str); 13 14 if (iserror(cube)) { 15 printf("Error reading cube\n"); 16 } else if (!issolvable(cube)) { 17 printf("Cube is not solvable\n"); 18 } else { 19 writecube("H48", cube, str); 20 printf("%s\n", str); 21 } 22 }