summaryrefslogtreecommitdiffstats
path: root/kmines/solver/testFast.cpp
blob: 7dbaa75775bf66688dd07729236d7a0baf337b2e (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
/** A program to test advisory library */

#include "bfield.h"
#include "headerP.h"

#define W 10
#define H 10

int main(int argc, char *argv[])
{
    long seed = (argc < 2 ? time(0) : atoi(argv[1]));
    cout << "seed = " << seed << endl;

    BaseField f(seed);
    f.reset(W, H, 10);

    KRandomSequence random(seed);
    Coord c(random.getLong(W), random.getLong(H));
    f.doReveal(c, 0, 0);

	AdviseFast::FactSet facts(&f);
	AdviseFast::RuleSet rules(&facts);

	rules.solve();

	cout << f << endl;
	if(!f.isSolved()) cout << facts << endl;

	return 0;
}