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

commit 1d35e5189ba441967cb1585c340452e6125f5ba5
parent c2275e4b9625a1a19eb50d0880f70ed583d5c358
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Mon,  8 Jul 2024 19:38:00 +0200

Added average to stats tool

Diffstat:
Mtools/stats_tables_h48/stats_tables_h48.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/stats_tables_h48/stats_tables_h48.c b/tools/stats_tables_h48/stats_tables_h48.c @@ -31,6 +31,7 @@ void run(void) { int i, j, k; char sols[12], cube[22]; int64_t ep, eo, cp, co, v[12][100] = {0}; + double avg; for (i = 0; i < NCUBES; i++) { ep = rand64(); @@ -48,8 +49,13 @@ void run(void) { for (j = 0; j < 12; j++) { printf("Data for h=%d\n", j); - for (k = 0; k <= 16; k++) + avg = 0.0; + for (k = 0; k <= 16; k++) { printf("%d\t%" PRId64 "\n", k, v[j][k]); + avg += v[j][k] * k; + } + avg /= (double)NCUBES; + printf("Average: %.4lf\n", avg); printf("\n"); } }