aboutsummaryrefslogtreecommitdiff
path: root/test/070_solve_simple/solve_simple_tests.c
blob: 14a16742077610df74619ac6dec094f77c72a91f (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef CUBE_AVX2
#include <immintrin.h>
#endif

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

#define S 10000

int main() {
	char cubestr[S], solverstr[S], optionsstr[S], nisstypestr[S];
	char minmovesstr[S], maxmovesstr[S], maxsolsstr[S], optimalstr[S];
	char solutionsstr[S];
	cube_t cube;
	int64_t maxsols;
	int8_t minmoves, maxmoves, optimal;

	fgets(cubestr, S, stdin);
	fgets(solverstr, S, stdin);
	fgets(optionsstr, S, stdin);
	fgets(nisstypestr, S, stdin);
	fgets(minmovesstr, S, stdin);
	fgets(maxmovesstr, S, stdin);
	fgets(maxsolsstr, S, stdin);
	fgets(optimalstr, S, stdin);

	solverstr[strcspn(solverstr, "\n")] = 0;
	optionsstr[strcspn(optionsstr, "\n")] = 0;
	nisstypestr[strcspn(nisstypestr, "\n")] = 0;

	cube = readcube("H48", cubestr);
	minmoves = atoi(minmovesstr);
	maxmoves = atoi(maxmovesstr);
	maxsols = atoi(maxsolsstr);
	optimal = atoi(optimalstr);

	solve(
		cube,
		solverstr,
		optionsstr,
		nisstypestr,
		minmoves,
		maxmoves,
		maxsols,
		optimal,
		NULL,
		solutionsstr
	);

	printf("%s", solutionsstr);

	return 0;
}

Generated with cgit - Back to sebastiano.tronto.net