aboutsummaryrefslogtreecommitdiff
path: root/test/011_io_SRC/io_SRC_tests.c
blob: f454b6f6b9466017be72e2e925fd2a1a9d28b78a (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
25
26
27
28
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

#include "../../src/cube.h"

#define STRLENMAX 10000

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

	for (c = str; (*c = getchar()) != EOF; c++) ;
	*c = '\0';

	cube = readcube(H48, str);

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

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net