mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-20 11:54:48 +00:00
rulegen:: tests:: list coordination sequences
This commit is contained in:
parent
1343eacc1c
commit
0fb6ddb3bc
@ -429,7 +429,9 @@ void test_rules() {
|
||||
println(hlog, "sequence: ", seq);
|
||||
}
|
||||
|
||||
void list_sequence() {
|
||||
fhstream *seq_stream;
|
||||
|
||||
void list_all_sequences(string tesname) {
|
||||
|
||||
int N = isize(treestates);
|
||||
if(!N) {
|
||||
@ -437,12 +439,14 @@ void list_sequence() {
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i=0; i<N; i++) if(treestates[i].is_root) {
|
||||
vector<bignum> howmany(N);
|
||||
howmany[0] = 1;
|
||||
|
||||
howmany[i] = 1;
|
||||
|
||||
vector<string> seq;
|
||||
|
||||
for(int iter=0; iter<30; iter++) {
|
||||
for(int iter=0; iter<60; iter++) {
|
||||
bignum total;
|
||||
for(auto& h: howmany) total += h;
|
||||
seq.push_back(total.get_str(100));
|
||||
@ -453,7 +457,11 @@ void list_sequence() {
|
||||
howmany = std::move(next);
|
||||
}
|
||||
|
||||
println(hlog, "sequence: ", seq);
|
||||
println(*seq_stream, (hyperbolic ? "H " : "E "), "FILE ", tesname, ", id ");
|
||||
println(*seq_stream, seq);
|
||||
}
|
||||
|
||||
fflush(seq_stream->f);
|
||||
}
|
||||
|
||||
void print_rules();
|
||||
@ -772,7 +780,9 @@ void test_current(string tesname) {
|
||||
/* for(auto& a: analyzers)
|
||||
println(hlog, "analyzer ", a.first, " size is ", isize(a.second.spread)); */
|
||||
fflush(stdout);
|
||||
list_sequence();
|
||||
|
||||
if(seq_stream)
|
||||
list_all_sequences(tesname);
|
||||
|
||||
fflush(stdout);
|
||||
}
|
||||
@ -1134,6 +1144,11 @@ int testargs() {
|
||||
shift(); origin_id = argi();
|
||||
}
|
||||
|
||||
else if(argis("-seqf")) {
|
||||
shift();
|
||||
seq_stream = new fhstream(args(), "w");
|
||||
}
|
||||
|
||||
else if(argis("-tesgen")) {
|
||||
shift(); string s = args();
|
||||
set_general(s);
|
||||
|
Loading…
Reference in New Issue
Block a user