cubecore

A library of core functions for working with 3x3x3 Rubik's cubes
git clone https://git.tronto.net/cubecore
Download | Log | Files | Refs | README | LICENSE

io_LST_tests.c (426B)


      1 #include "../test.h"
      2 
      3 int main(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 = cube_read("H48", str);
     13 
     14 	if (cube_error(cube)) {
     15 		printf("Error reading cube\n");
     16 	} else if (!cube_solvable(cube)) {
     17 		printf("Cube is not solvable\n");
     18 	} else {
     19 		cube_write("LST", cube, str);
     20 		printf("%s\n", str);
     21 	}
     22 
     23 	return 0;
     24 }