diff options
-rw-r--r-- | cacount.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cacount.cpp b/cacount.cpp index 3b385ab..ca6c1ab 100644 --- a/cacount.cpp +++ b/cacount.cpp @@ -7,12 +7,12 @@ #include <functional> #include <iostream> #include <map> - +#include <set> using namespace std; typedef uint32_t State; -const State logState = 16; +const State logState = 31; const State maxState = 1 << logState; bitset<8> rule(110); @@ -33,9 +33,14 @@ void iterState(function<void(int)> f) { for (State s=0; s<maxState; s++) f(s); } -void iterTrans(int times, function<void(int)> f) { - while (times--) + +void iterTrans(int times, function<void(int)> f, bool verbose=false) { + if (verbose) cerr << times << " left\r"; + while (times--) { iterState(f); + if (verbose) cerr << times << " left\r"; + } + if (verbose) cerr << " \r"; } void init(Trans &t) { |