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

gendata_cocsep_tests.c (691B)


      1 #include "../test.h"
      2 
      3 #define BUF_SIZE 2000000
      4 
      5 size_t gendata_cocsep(void *, uint64_t *, cube_t *);
      6 bool readtableinfo(uint64_t, const char *, tableinfo_t *);
      7 
      8 void run(void) {
      9 	char buf[BUF_SIZE];
     10 	uint32_t i;
     11 	uint64_t selfsim[COCSEP_CLASSES];
     12 	cube_t rep[COCSEP_CLASSES];
     13 	size_t result;
     14 	tableinfo_t info;
     15 
     16 	result = gendata_cocsep(buf, selfsim, rep);
     17 	if (readtableinfo(BUF_SIZE, buf, &info) != NISSY_OK) {
     18 		printf("Error reading info from table\n");
     19 		return;
     20 	}
     21 
     22 	printf("%zu\n", result);
     23 	printf("Classes: %" PRIu64 "\n", info.classes);
     24 	printf("Max value: %" PRIu8 "\n", info.maxvalue);
     25 	for (i = 0; i < 10; i++)
     26 		printf("%" PRIu32 ": %" PRIu64 "\n", i, info.distribution[i]);
     27 }