From c90c389a8a8d9d8661e9772ec4144c5cf2039f23 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmines/solver/testFast.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 kmines/solver/testFast.cpp (limited to 'kmines/solver/testFast.cpp') diff --git a/kmines/solver/testFast.cpp b/kmines/solver/testFast.cpp new file mode 100644 index 00000000..7dbaa757 --- /dev/null +++ b/kmines/solver/testFast.cpp @@ -0,0 +1,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; +} -- cgit v1.2.1