From 7faca28009c5efb0ba2b897b34dbdcac47a1a6f3 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 25 Apr 2025 10:09:22 +0200 Subject: NISS --- test/051_compose_oriented/00_scrambled_noorient.in | 4 ++++ .../051_compose_oriented/00_scrambled_noorient.out | 1 + test/051_compose_oriented/01_Uw_Fw.in | 2 ++ test/051_compose_oriented/01_Uw_Fw.out | 1 + .../051_compose_oriented/02_scrambled_scrambled.in | 4 ++++ .../02_scrambled_scrambled.out | 1 + test/051_compose_oriented/compose_oriented_tests.c | 24 ++++++++++++++++++++++ 7 files changed, 37 insertions(+) create mode 100644 test/051_compose_oriented/00_scrambled_noorient.in create mode 100644 test/051_compose_oriented/00_scrambled_noorient.out create mode 100644 test/051_compose_oriented/01_Uw_Fw.in create mode 100644 test/051_compose_oriented/01_Uw_Fw.out create mode 100644 test/051_compose_oriented/02_scrambled_scrambled.in create mode 100644 test/051_compose_oriented/02_scrambled_scrambled.out create mode 100644 test/051_compose_oriented/compose_oriented_tests.c (limited to 'test/051_compose_oriented') diff --git a/test/051_compose_oriented/00_scrambled_noorient.in b/test/051_compose_oriented/00_scrambled_noorient.in new file mode 100644 index 0000000..904292f --- /dev/null +++ b/test/051_compose_oriented/00_scrambled_noorient.in @@ -0,0 +1,4 @@ +CILVXGMR=FKbGIDSXBJAU=A +JLQWSVUH=ZLCUABGIVTKH=A +// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B' +// Followed by R' U' F diff --git a/test/051_compose_oriented/00_scrambled_noorient.out b/test/051_compose_oriented/00_scrambled_noorient.out new file mode 100644 index 0000000..426e4fe --- /dev/null +++ b/test/051_compose_oriented/00_scrambled_noorient.out @@ -0,0 +1 @@ +QFSEDWPR=ZUbYFKSBTWAX=A diff --git a/test/051_compose_oriented/01_Uw_Fw.in b/test/051_compose_oriented/01_Uw_Fw.in new file mode 100644 index 0000000..d50425a --- /dev/null +++ b/test/051_compose_oriented/01_Uw_Fw.in @@ -0,0 +1,2 @@ +ABHGEFCD=ABHGEFCDIJKL=B +AXUDJFGK=ABCDEKJHIFGL=Q diff --git a/test/051_compose_oriented/01_Uw_Fw.out b/test/051_compose_oriented/01_Uw_Fw.out new file mode 100644 index 0000000..5b15c06 --- /dev/null +++ b/test/051_compose_oriented/01_Uw_Fw.out @@ -0,0 +1 @@ +MBKGXFQD=ZBHYEFCDQWKL=J diff --git a/test/051_compose_oriented/02_scrambled_scrambled.in b/test/051_compose_oriented/02_scrambled_scrambled.in new file mode 100644 index 0000000..5b814bc --- /dev/null +++ b/test/051_compose_oriented/02_scrambled_scrambled.in @@ -0,0 +1,4 @@ +JHFGDMQS=ZaUGRCFHQbTY=W +DCNORMXQ=YbaDFECXWRJA=G +// First cube: "F R Uw Lw' D E2 x y M" +// Second cube: "x R U R' Fw2 Bw y' S3" diff --git a/test/051_compose_oriented/02_scrambled_scrambled.out b/test/051_compose_oriented/02_scrambled_scrambled.out new file mode 100644 index 0000000..e6a0684 --- /dev/null +++ b/test/051_compose_oriented/02_scrambled_scrambled.out @@ -0,0 +1 @@ +VSMPGQJD=ZRHFLUCKAWYT=Q diff --git a/test/051_compose_oriented/compose_oriented_tests.c b/test/051_compose_oriented/compose_oriented_tests.c new file mode 100644 index 0000000..f677dd6 --- /dev/null +++ b/test/051_compose_oriented/compose_oriented_tests.c @@ -0,0 +1,24 @@ +#include "../test.h" + +oriented_cube_t compose_oriented(oriented_cube_t, oriented_cube_t); + +void run(void) { + char str[STRLENMAX]; + oriented_cube_t c1, c2, c3; + + fgets(str, STRLENMAX, stdin); + c1 = readcube(str); + fgets(str, STRLENMAX, stdin); + c2 = readcube(str); + + c3 = compose_oriented(c1, c2); + + if (iserror(c3)) { + printf("Error composing cubes\n"); + } else if (!issolvable(c3)) { + printf("Composed cube is not solvable\n"); + } else { + writecube(c3, NISSY_SIZE_CUBE, str); + printf("%s\n", str); + } +} -- cgit v1.3