From 28ad019d62583b7e89b4e76922aa73857d5876eb Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 28 May 2024 15:42:26 +0200 Subject: Added roadmap for refactor and some simple routines --- test/001_pieces/pieces_tests.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/001_pieces/pieces_tests.c (limited to 'test/001_pieces/pieces_tests.c') diff --git a/test/001_pieces/pieces_tests.c b/test/001_pieces/pieces_tests.c new file mode 100644 index 0000000..f3d8d4e --- /dev/null +++ b/test/001_pieces/pieces_tests.c @@ -0,0 +1,28 @@ +#include "../test.h" + +uint8_t corner(cube_fast_t, int); +uint8_t edge(cube_fast_t, int); + +int main(void) { + int i; + char str[STRLENMAX], *aux; + cube_t cube; + cube_fast_t fast; + + aux = str; + while (fgets(aux, STRLENMAX, stdin) != NULL) + while (*aux != '\n') + aux++; + + cube = readcube("H48", str); + fast = cubetofast(cube); + + for (i = 0; i < 8; i++) + printf("%" PRIu8 " ", corner(fast, i)); + printf("\n"); + for (i = 0; i < 12; i++) + printf("%" PRIu8 " ", edge(fast, i)); + printf("\n"); + + return 0; +} -- cgit v1.3