From ffe8e9cef391b0e3b588fc01451fb56b3bef70e9 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 23 Aug 2022 21:50:18 +0200 Subject: [PATCH] rulegen::tests:: display 3D fields --- devmods/rulegen-tests.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/devmods/rulegen-tests.cpp b/devmods/rulegen-tests.cpp index 76e94e05..25935b92 100644 --- a/devmods/rulegen-tests.cpp +++ b/devmods/rulegen-tests.cpp @@ -1747,6 +1747,24 @@ int testargs() { println(hlog, "wrong dseek index"); } + else if(argis("-fields")) { + fieldpattern::fpattern fp(0); + start_game(); + fp.force_hash = 1; + fieldpattern::use_quotient_fp = true; + set seen_hashes; + addHook(fieldpattern::hooks_solve3, 100, [&] { + if(seen_hashes.count(fp.hashv)) return; + seen_hashes.insert(fp.hashv); + println(hlog, "FOUND p=", fp.Prime, " f=", fp.Field, " hash = ", fp.hashv); + }); + for(int p=2; p<100; p++) { + println(hlog, "listing hashes for p=", p); + fp.Prime = p; + fp.solve(); + } + } + else return 1; return 0; }