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

int main(void) {
	char str[STRLENMAX], *aux;
	cube_t cube;

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

	cube = cube_read("H48", str);

	if (cube_error(cube)) {
		printf("Error reading cube\n");
	} else if (!cube_solvable(cube)) {
		printf("Cube is not solvable\n");
	} else {
		cube_write("H48", cube, str);
		printf("%s\n", str);
	}

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net