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

compose_oriented_tests.c (508B)


      1 #include "../test.h"
      2 
      3 oriented_cube_t compose_oriented(oriented_cube_t, oriented_cube_t);
      4 
      5 void run(void) {
      6 	char str[STRLENMAX];
      7 	oriented_cube_t c1, c2, c3;
      8 
      9 	fgets(str, STRLENMAX, stdin);
     10 	c1 = readcube(str);
     11 	fgets(str, STRLENMAX, stdin);
     12 	c2 = readcube(str);
     13 
     14 	c3 = compose_oriented(c1, c2);
     15 
     16 	if (iserror(c3)) {
     17 		printf("Error composing cubes\n");
     18 	} else if (!issolvable(c3)) {
     19 		printf("Composed cube is not solvable\n");
     20 	} else {
     21 		writecube(c3, NISSY_SIZE_CUBE, str);
     22 		printf("%s\n", str);
     23 	}
     24 }