aboutsummaryrefslogtreecommitdiff
path: root/tools/stats_tables_h48
diff options
context:
space:
mode:
Diffstat (limited to 'tools/stats_tables_h48')
-rw-r--r--tools/stats_tables_h48/stats_tables_h48.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/stats_tables_h48/stats_tables_h48.c b/tools/stats_tables_h48/stats_tables_h48.c
index 9f9bacf..b349f63 100644
--- a/tools/stats_tables_h48/stats_tables_h48.c
+++ b/tools/stats_tables_h48/stats_tables_h48.c
@@ -5,17 +5,13 @@
5#define MAXMOVES 20 5#define MAXMOVES 20
6#define NCUBES 1000 6#define NCUBES 1000
7 7
8typedef struct { uint8_t n[16]; } i128;
9
10char *buf; 8char *buf;
11 9
12i128 rand128(void) { 10uint64_t rand64(void) {
13 uint8_t i, j; 11 uint64_t i, ret;
14 i128 ret = {0};
15 12
16 for (i = 0; i < 16; i++) 13 for (i = 0, ret = 0; i < 64; i++)
17 for (j = 0; j < 8; j++) 14 ret |= (uint64_t)(rand() % 2) << i;
18 ret.n[i] |= (uint8_t)(rand() % 2) << j;
19 15
20 return ret; 16 return ret;
21} 17}
@@ -28,7 +24,7 @@ void run(void) {
28 uint32_t *h48info; 24 uint32_t *h48info;
29 int i, j; 25 int i, j;
30 char sols[13], cube[22]; 26 char sols[13], cube[22];
31 int64_t s, v[13][100] = {0}; 27 int64_t s, ep, eo, cp, co, v[13][100] = {0};
32 28
33 s = nissy_gendata("H48stats", "", buf); 29 s = nissy_gendata("H48stats", "", buf);
34 30
@@ -38,7 +34,11 @@ void run(void) {
38 } 34 }
39 35
40 for (i = 0; i < NCUBES; i++) { 36 for (i = 0; i < NCUBES; i++) {
41 nissy_gencube(rand128(), "", cube); 37 ep = rand64();
38 eo = rand64();
39 cp = rand64();
40 co = rand64();
41 nissy_getcube(ep, eo, cp, co, "fix", cube);
42 nissy_solve(cube, "H48stats", 42 nissy_solve(cube, "H48stats",
43 "", "", "", 0, MAXMOVES, 1, -1, buf, sols); 43 "", "", "", 0, MAXMOVES, 1, -1, buf, sols);
44 for (j = 0; j < 13; j++) 44 for (j = 0; j < 13; j++)

Generated with cgit - Back to sebastiano.tronto.net