aboutsummaryrefslogtreecommitdiff
path: root/test/020_io_cube_read_write/io_cube_tests.c
blob: 3d7601c0f83b8732eea91236b023d9798fc0adda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "../test.h"

void run(void) {
	char str[STRLENMAX], *aux;
	oriented_cube_t cube;

	aux = str;
	while (fgets(aux, STRLENMAX, stdin) != NULL)
		while (*aux != '\n')
			aux++;

	cube = readcube(str);

	if (iserror(cube)) {
		printf("Error reading cube\n");
	} else if (!issolvable(cube)) {
		printf("Cube is not solvable\n");
	} else {
		writecube(cube, NISSY_SIZE_CUBE, str);
		printf("%s\n", str);
	}
}

Generated with cgit - Back to sebastiano.tronto.net