aboutsummaryrefslogtreecommitdiff
path: root/test/04_compose/compose_tests.c
blob: ae34f6d2d6fb631b90cc87ec91fa2a05449ec189 (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
29
30
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

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

#define STRLENMAX 10000

int main() {
	char str[STRLENMAX];
	cube_t c1, c2, c3;

	fgets(str, STRLENMAX, stdin);
	c1 = readcube(str);
	fgets(str, STRLENMAX, stdin);
	c2 = readcube(str);

	c3 = compose(c1, c2);

	if (iserror(c3)) {
		printf("Error composing cubes\n");
	} else if (!isconsistent(c3)) {
		printf("Composed cube is inconsistent\n");
	} else {
		writecube(c3, str);
		printf("%s\n", str);
	}

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net