nissy-core

The "engine" of nissy, including the H48 optimal solver.
git clone https://git.tronto.net/nissy-core
Download | Log | Files | Refs | README | LICENSE

io_cube_tests.c (411B)


      1 #include "../test.h"
      2 
      3 void run(void) {
      4 	char str[STRLENMAX], *aux;
      5 	oriented_cube_t cube;
      6 
      7 	aux = str;
      8 	while (fgets(aux, STRLENMAX, stdin) != NULL)
      9 		while (*aux != '\n')
     10 			aux++;
     11 
     12 	cube = readcube(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(cube, NISSY_SIZE_CUBE, str);
     20 		printf("%s\n", str);
     21 	}
     22 }