aboutsummaryrefslogtreecommitdiff
path: root/test/033_inverse_move/inverse_move_tests.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-23 21:34:06 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-23 21:34:06 +0200
commit17e5a9e1e2b241c67956651f87f40236467fe7d8 (patch)
tree00e9eb137f6b3be8e1d287f25b0ad24d6658a2b3 /test/033_inverse_move/inverse_move_tests.c
parent9c209afd81e4c51e4fc2717c0eeff4a5d116bcb0 (diff)
downloadnissy-core-17e5a9e1e2b241c67956651f87f40236467fe7d8.tar.gz
nissy-core-17e5a9e1e2b241c67956651f87f40236467fe7d8.zip
Added tests for inverse move
Diffstat (limited to 'test/033_inverse_move/inverse_move_tests.c')
-rw-r--r--test/033_inverse_move/inverse_move_tests.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/033_inverse_move/inverse_move_tests.c b/test/033_inverse_move/inverse_move_tests.c
new file mode 100644
index 0000000..dc9845c
--- /dev/null
+++ b/test/033_inverse_move/inverse_move_tests.c
@@ -0,0 +1,20 @@
1#include "../test.h"
2
3extern char *movestr[];
4
5int64_t readmoves(const char *, size_t n, uint8_t [n]);
6uint8_t inverse_move(uint8_t);
7
8void run(void) {
9 uint8_t moves[2];
10
11 char moves_string[STRLENMAX];
12
13 fgets(moves_string, STRLENMAX, stdin);
14 if (readmoves(moves_string, 2, moves) != 1) {
15 printf("Test error: cannot read moves\n");
16 return;
17 }
18
19 printf("%s\n", movestr[inverse_move(moves[0])]);
20}

Generated with cgit - Back to sebastiano.tronto.net