From c14e780551c4e7aa88d99b226b12f7cdd7b92527 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 30 Mar 2024 18:40:02 +0100 Subject: Added cocsep data generation, but it is very slow --- test/061_inverse_trans/00_all.in | 0 test/061_inverse_trans/00_all.out | 0 test/061_inverse_trans/inverse_trans_tests.c | 38 ++++++++++++++++++++++++++ test/100_gendata_cocsep/00_all.in | 0 test/100_gendata_cocsep/00_all.out | 1 + test/100_gendata_cocsep/gendata_cocsep_tests.c | 14 ++++++++++ test/test.h | 1 + 7 files changed, 54 insertions(+) create mode 100644 test/061_inverse_trans/00_all.in create mode 100644 test/061_inverse_trans/00_all.out create mode 100644 test/061_inverse_trans/inverse_trans_tests.c create mode 100644 test/100_gendata_cocsep/00_all.in create mode 100644 test/100_gendata_cocsep/00_all.out create mode 100644 test/100_gendata_cocsep/gendata_cocsep_tests.c (limited to 'test') diff --git a/test/061_inverse_trans/00_all.in b/test/061_inverse_trans/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/061_inverse_trans/00_all.out b/test/061_inverse_trans/00_all.out new file mode 100644 index 0000000..e69de29 diff --git a/test/061_inverse_trans/inverse_trans_tests.c b/test/061_inverse_trans/inverse_trans_tests.c new file mode 100644 index 0000000..77bd40b --- /dev/null +++ b/test/061_inverse_trans/inverse_trans_tests.c @@ -0,0 +1,38 @@ +#include "../test.h" + +uint8_t readtrans(char *); +uint8_t inverse_trans(uint8_t); +cube_t applymoves(cube_t, char *); +cube_t applytrans(cube_t, char *); +extern char *transstr[]; + +int main(void) { + uint8_t t, tinv; + cube_t cube; + + for (t = 0; t < 48; t++) { + cube = solvedcube(); + cube = applymoves(cube, "R"); + cube = applymoves(cube, "U"); + cube = applymoves(cube, "F"); + + cube = applytrans(cube, transstr[t]); + tinv = inverse_trans(t); + cube = applytrans(cube, transstr[tinv]); + + if (iserror(cube)) { + printf("Error transforming cube\n"); + } else if (!issolvable(cube)) { + printf("Transformed cube is not solvable\n"); + } else { + cube = applymoves(cube, "F'"); + cube = applymoves(cube, "U'"); + cube = applymoves(cube, "R'"); + if (!issolved(cube)) + printf("%s: Error! Got %" PRIu8 "\n", + transstr[t], tinv); + } + } + + return 0; +} diff --git a/test/100_gendata_cocsep/00_all.in b/test/100_gendata_cocsep/00_all.in new file mode 100644 index 0000000..e69de29 diff --git a/test/100_gendata_cocsep/00_all.out b/test/100_gendata_cocsep/00_all.out new file mode 100644 index 0000000..37b8c1d --- /dev/null +++ b/test/100_gendata_cocsep/00_all.out @@ -0,0 +1 @@ +1119788 diff --git a/test/100_gendata_cocsep/gendata_cocsep_tests.c b/test/100_gendata_cocsep/gendata_cocsep_tests.c new file mode 100644 index 0000000..19dfa9f --- /dev/null +++ b/test/100_gendata_cocsep/gendata_cocsep_tests.c @@ -0,0 +1,14 @@ +#include "../test.h" + +size_t gendata_cocsep(void *); + +int main(void) { + uint32_t buf[300000]; + size_t result; + + result = gendata_cocsep(buf); + + printf("%zu\n", result); + + return 0; +} diff --git a/test/test.h b/test/test.h index 7c5400e..3cbfd10 100644 --- a/test/test.h +++ b/test/test.h @@ -22,5 +22,6 @@ typedef cube_t cube_fast_t; cube_t solvedcube(void); bool iserror(cube_t); bool issolvable(cube_t); +bool issolved(cube_t); cube_t readcube(char *, char *); void writecube(char *, cube_t, char *); -- cgit v1.3