aboutsummaryrefslogtreecommitdiff
path: root/test/032_invertmoves/invertmoves_tests.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-03-24 23:09:26 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-03-24 23:09:26 +0100
commitd45e1595ec1cffeab83ac6602b748250b66bea03 (patch)
tree44b35714cdae22026fc5e15648e91684a2fbb154 /test/032_invertmoves/invertmoves_tests.c
parentce3f1cc0ef9f46d70ab5387b1458e9098b40711d (diff)
downloadnissy-core-d45e1595ec1cffeab83ac6602b748250b66bea03.tar.gz
nissy-core-d45e1595ec1cffeab83ac6602b748250b66bea03.zip
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
Diffstat (limited to 'test/032_invertmoves/invertmoves_tests.c')
-rw-r--r--test/032_invertmoves/invertmoves_tests.c21
1 files changed, 0 insertions, 21 deletions
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 @@
1#include "../test.h"
2
3#define MAXMOVES 20
4
5int64_t readmoves(const char *, int, uint8_t *);
6void writemoves(size_t n, uint8_t [n], size_t m, char [m]);
7void invertmoves(size_t n, const uint8_t [n], uint8_t [n]);
8
9void run(void) {
10 char movestr[STRLENMAX], outstr[STRLENMAX];
11 uint8_t moves[MAXMOVES], ret[MAXMOVES];
12 int c;
13
14 fgets(movestr, STRLENMAX, stdin);
15 c = readmoves(movestr, MAXMOVES, moves);
16
17 invertmoves(c, moves, ret);
18 writemoves(c, ret, STRLENMAX, outstr);
19
20 printf("%s\n", outstr);
21}

Generated with cgit - Back to sebastiano.tronto.net