inverse_tests.c (392B)
1 #include "../test.h" 2 3 cube_t inverse(cube_t); 4 5 void run(void) { 6 char str[STRLENMAX]; 7 cube_t cube, inv; 8 9 fgets(str, STRLENMAX, stdin); 10 cube = readcube("H48", str); 11 inv = inverse(cube); 12 13 if (iserror(inv)) { 14 printf("Error inverting cube\n"); 15 } else if (!issolvable(inv)) { 16 printf("Inverted cube is not solvable\n"); 17 } else { 18 writecube("H48", inv, str); 19 printf("%s\n", str); 20 } 21 }