h48

A prototype for an optimal Rubik's cube solver, work in progress.
git clone https://git.tronto.net/h48
Download | Log | Files | Refs | README | LICENSE

pieces_tests.c (498B)


      1 #include "../test.h"
      2 
      3 void pieces(cube_t *, uint8_t [static 8], uint8_t [static 12]);
      4 
      5 void run(void) {
      6 	int i;
      7 	uint8_t corner[8], edge[12];
      8 	char str[STRLENMAX], *aux;
      9 	cube_t cube;
     10 
     11         aux = str;
     12 	while (fgets(aux, STRLENMAX, stdin) != NULL)
     13 		while (*aux != '\n')
     14 			aux++;
     15 
     16 	cube = readcube("H48", str);
     17 	pieces(&cube, corner, edge);
     18 
     19 	for (i = 0; i < 8; i++)
     20 		printf("%" PRIu8 " ", corner[i]);
     21 	printf("\n");
     22 	for (i = 0; i < 12; i++)
     23 		printf("%" PRIu8 " ", edge[i]);
     24 	printf("\n");
     25 }