From d45e1595ec1cffeab83ac6602b748250b66bea03 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 24 Mar 2025 23:09:26 +0100 Subject: Big cleanup for appendsolution() With this PR the appendsolution routine is extracted from the h48 solver and the new coordinate solver and made generic. This has many advantages: - less repetition (even if the two versions are different enough that *for now* it was not a big deal) - smaller h48/solve.h file, which is already a big beast - easier to test the appendsolution() routine separately --- test/032_invertmoves/001_onemove.in | 1 - test/032_invertmoves/001_onemove.out | 1 - test/032_invertmoves/002_20moves.in | 1 - test/032_invertmoves/002_20moves.out | 1 - test/032_invertmoves/invertmoves_tests.c | 21 --------------------- 5 files changed, 25 deletions(-) delete mode 100644 test/032_invertmoves/001_onemove.in delete mode 100644 test/032_invertmoves/001_onemove.out delete mode 100644 test/032_invertmoves/002_20moves.in delete mode 100644 test/032_invertmoves/002_20moves.out delete mode 100644 test/032_invertmoves/invertmoves_tests.c (limited to 'test/032_invertmoves') diff --git a/test/032_invertmoves/001_onemove.in b/test/032_invertmoves/001_onemove.in deleted file mode 100644 index cf84443..0000000 --- a/test/032_invertmoves/001_onemove.in +++ /dev/null @@ -1 +0,0 @@ -F diff --git a/test/032_invertmoves/001_onemove.out b/test/032_invertmoves/001_onemove.out deleted file mode 100644 index 6ab6e07..0000000 --- a/test/032_invertmoves/001_onemove.out +++ /dev/null @@ -1 +0,0 @@ -F' diff --git a/test/032_invertmoves/002_20moves.in b/test/032_invertmoves/002_20moves.in deleted file mode 100644 index 052ed94..0000000 --- a/test/032_invertmoves/002_20moves.in +++ /dev/null @@ -1 +0,0 @@ -B2 R D2 B2 R D2 F2 L2 F2 R' F2 D' L D2 L U2 L B2 F2 U diff --git a/test/032_invertmoves/002_20moves.out b/test/032_invertmoves/002_20moves.out deleted file mode 100644 index bc6a079..0000000 --- a/test/032_invertmoves/002_20moves.out +++ /dev/null @@ -1 +0,0 @@ -U' F2 B2 L' U2 L' D2 L' D F2 R F2 L2 F2 D2 R' B2 D2 R' B2 diff --git a/test/032_invertmoves/invertmoves_tests.c b/test/032_invertmoves/invertmoves_tests.c deleted file mode 100644 index d791524..0000000 --- a/test/032_invertmoves/invertmoves_tests.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "../test.h" - -#define MAXMOVES 20 - -int64_t readmoves(const char *, int, uint8_t *); -void writemoves(size_t n, uint8_t [n], size_t m, char [m]); -void invertmoves(size_t n, const uint8_t [n], uint8_t [n]); - -void run(void) { - char movestr[STRLENMAX], outstr[STRLENMAX]; - uint8_t moves[MAXMOVES], ret[MAXMOVES]; - int c; - - fgets(movestr, STRLENMAX, stdin); - c = readmoves(movestr, MAXMOVES, moves); - - invertmoves(c, moves, ret); - writemoves(c, ret, STRLENMAX, outstr); - - printf("%s\n", outstr); -} -- cgit v1.3