blob: 2f0ecfb233bda76a0fa375fc3652f1937bb3d64c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include "../test.h"
cube_t applymoves(cube_t, char *);
void run(void) {
char movestr[STRLENMAX], cubestr[STRLENMAX];
cube_t cube;
fgets(movestr, STRLENMAX, stdin);
fgets(cubestr, STRLENMAX, stdin);
cube = readcube("H48", cubestr);
cube = applymoves(cube, movestr);
if (iserror(cube)) {
printf("Error moving cube\n");
} else if (!issolvable(cube)) {
printf("Moved cube is not solvable\n");
} else {
writecube("H48", cube, NISSY_SIZE_H48, cubestr);
printf("%s\n", cubestr);
}
}
|