diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-22 06:43:11 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-03-22 18:45:47 +0100 |
| commit | ce3f1cc0ef9f46d70ab5387b1458e9098b40711d (patch) | |
| tree | 4949745670b829f2211381bf14b8440dcc6ca7b1 /test/080_allowednext | |
| parent | 0550a16c1cce868bbc3f3b5ad59f80e35cf2a6cd (diff) | |
| download | nissy-core-ce3f1cc0ef9f46d70ab5387b1458e9098b40711d.tar.gz nissy-core-ce3f1cc0ef9f46d70ab5387b1458e9098b40711d.zip | |
Some safety with move arrays, small refactor appendchar
Diffstat (limited to 'test/080_allowednext')
| -rw-r--r-- | test/080_allowednext/allowednext_tests.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/080_allowednext/allowednext_tests.c b/test/080_allowednext/allowednext_tests.c index 644d4c5..08fe491 100644 --- a/test/080_allowednext/allowednext_tests.c +++ b/test/080_allowednext/allowednext_tests.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | #include "../test.h" | 1 | #include "../test.h" |
| 2 | 2 | ||
| 3 | bool allowednextmove(uint8_t *, uint8_t); | 3 | bool allowednextmove(size_t n, const uint8_t [n]); |
| 4 | 4 | ||
| 5 | static char *moves[] = { | 5 | static char *moves[] = { |
| 6 | "U", "U2", "U'", | 6 | "U", "U2", "U'", |
| @@ -31,5 +31,5 @@ void run(void) { | |||
| 31 | n > 2 ? moves[m[n-3]] : "-", | 31 | n > 2 ? moves[m[n-3]] : "-", |
| 32 | n > 1 ? moves[m[n-2]] : "-", | 32 | n > 1 ? moves[m[n-2]] : "-", |
| 33 | n > 0 ? moves[m[n-1]] : "-"); | 33 | n > 0 ? moves[m[n-1]] : "-"); |
| 34 | printf("%s\n", allowednextmove(m, n) ? "true" : "false"); | 34 | printf("%s\n", allowednextmove(n, m) ? "true" : "false"); |
| 35 | } | 35 | } |
