aboutsummaryrefslogtreecommitdiff
path: root/test/080_solve_simple
diff options
context:
space:
mode:
Diffstat (limited to 'test/080_solve_simple')
-rw-r--r--test/080_solve_simple/01_U_U3.in8
-rw-r--r--test/080_solve_simple/01_U_U3.out1
-rw-r--r--test/080_solve_simple/02_MUMU_alloptimal.in8
-rw-r--r--test/080_solve_simple/02_MUMU_alloptimal.out4
-rw-r--r--test/080_solve_simple/solve_simple_tests.c50
5 files changed, 71 insertions, 0 deletions
diff --git a/test/080_solve_simple/01_U_U3.in b/test/080_solve_simple/01_U_U3.in
new file mode 100644
index 0000000..c0f7930
--- /dev/null
+++ b/test/080_solve_simple/01_U_U3.in
@@ -0,0 +1,8 @@
1UR0 UL0 DB0 DF0 UB0 UF0 DL0 DR0 FR0 FL0 BL0 BR0 UBR0 UFL0 DFL0 DBR0 UFR0 UBL0 DFR0 DBL0
2simple
3
4normal
50
63
73
8-1
diff --git a/test/080_solve_simple/01_U_U3.out b/test/080_solve_simple/01_U_U3.out
new file mode 100644
index 0000000..ca934b4
--- /dev/null
+++ b/test/080_solve_simple/01_U_U3.out
@@ -0,0 +1 @@
U'
diff --git a/test/080_solve_simple/02_MUMU_alloptimal.in b/test/080_solve_simple/02_MUMU_alloptimal.in
new file mode 100644
index 0000000..f97c95f
--- /dev/null
+++ b/test/080_solve_simple/02_MUMU_alloptimal.in
@@ -0,0 +1,8 @@
1UB0 DF0 DB0 UF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0
2simple
3
4normal
50
6-1
710
80
diff --git a/test/080_solve_simple/02_MUMU_alloptimal.out b/test/080_solve_simple/02_MUMU_alloptimal.out
new file mode 100644
index 0000000..06cd521
--- /dev/null
+++ b/test/080_solve_simple/02_MUMU_alloptimal.out
@@ -0,0 +1,4 @@
1U2 R' L F2 R L'
2R U2 R' L F2 L'
3R L' U2 R' L F2
4L' U2 R' L F2 R
diff --git a/test/080_solve_simple/solve_simple_tests.c b/test/080_solve_simple/solve_simple_tests.c
new file mode 100644
index 0000000..4756dc0
--- /dev/null
+++ b/test/080_solve_simple/solve_simple_tests.c
@@ -0,0 +1,50 @@
1#include "../test.h"
2
3int64_t solve(cube_t, char *, char *, char *, int8_t, int8_t, int64_t, int8_t,
4 void *, char *);
5
6int main() {
7 char cubestr[STRLENMAX], solverstr[STRLENMAX], optionsstr[STRLENMAX];
8 char nisstypestr[STRLENMAX], minmovesstr[STRLENMAX];
9 char maxmovesstr[STRLENMAX], maxsolsstr[STRLENMAX];
10 char optimalstr[STRLENMAX], solutionsstr[STRLENMAX];
11 cube_t cube;
12 int64_t maxsols;
13 int8_t minmoves, maxmoves, optimal;
14
15 fgets(cubestr, STRLENMAX, stdin);
16 fgets(solverstr, STRLENMAX, stdin);
17 fgets(optionsstr, STRLENMAX, stdin);
18 fgets(nisstypestr, STRLENMAX, stdin);
19 fgets(minmovesstr, STRLENMAX, stdin);
20 fgets(maxmovesstr, STRLENMAX, stdin);
21 fgets(maxsolsstr, STRLENMAX, stdin);
22 fgets(optimalstr, STRLENMAX, stdin);
23
24 solverstr[strcspn(solverstr, "\n")] = 0;
25 optionsstr[strcspn(optionsstr, "\n")] = 0;
26 nisstypestr[strcspn(nisstypestr, "\n")] = 0;
27
28 cube = readcube("H48", cubestr);
29 minmoves = atoi(minmovesstr);
30 maxmoves = atoi(maxmovesstr);
31 maxsols = atoi(maxsolsstr);
32 optimal = atoi(optimalstr);
33
34 solve(
35 cube,
36 solverstr,
37 optionsstr,
38 nisstypestr,
39 minmoves,
40 maxmoves,
41 maxsols,
42 optimal,
43 NULL,
44 solutionsstr
45 );
46
47 printf("%s", solutionsstr);
48
49 return 0;
50}

Generated with cgit - Back to sebastiano.tronto.net