1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-03 18:22:49 +00:00

a separate, nicer field_quotient_3d function

This commit is contained in:
Zeno Rogue 2021-04-07 14:45:05 +02:00
parent f56b15a5ee
commit 35ae9bf34a

View File

@ -1130,6 +1130,19 @@ EX eGeometry readGeo(const string& ss) {
return gNormal; return gNormal;
} }
EX void field_quotient_3d(int p, unsigned hash) {
check_cgi();
cgi.require_basics();
stop_game_and_switch_mode(rg::nothing);
fieldpattern::field_from_current();
set_geometry(gFieldQuotient);
for(;; p++) {
println(hlog, "trying p = ", p);
currfp.Prime = p; currfp.force_hash = hash; if(!currfp.solve()) break;
}
println(hlog, "set prime = ", currfp.Prime);
}
int read_geom_args() { int read_geom_args() {
using namespace arg; using namespace arg;
if(0) ; if(0) ;
@ -1162,7 +1175,6 @@ int read_geom_args() {
fieldpattern::enableFieldChange(); fieldpattern::enableFieldChange();
} }
else if(argis("-to-fq")) { else if(argis("-to-fq")) {
cgi.require_basics();
int p = 2; int p = 2;
shift(); shift();
if(args() == "p") { if(args() == "p") {
@ -1170,11 +1182,7 @@ int read_geom_args() {
shift(); shift();
} }
unsigned hash = arghex(); unsigned hash = arghex();
stop_game_and_switch_mode(rg::nothing); field_quotient_3d(p, hash);
fieldpattern::field_from_current();
set_geometry(gFieldQuotient);
for(;; p++) { currfp.Prime = p; currfp.force_hash = hash; if(!currfp.solve()) break; }
println(hlog, "set prime = ", currfp.Prime);
} }
else if(argis("-cs")) { else if(argis("-cs")) {
shift(); cheat(); shift(); cheat();