mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	expansion: more commandline options, debug celldist, 'x' to disable
This commit is contained in:
		| @@ -452,7 +452,9 @@ void do_viewdist(cell *c, const transmatrix& V, color_t& wcol, color_t& fcol) { | |||||||
|       break; |       break; | ||||||
|       } |       } | ||||||
|     case ncDebug: { |     case ncDebug: { | ||||||
|       int d = celldistance(c, distance_from == dfPlayer ? cwt.at : currentmap->gamestart()); |       int d =  | ||||||
|  |         distance_from == dfStart && cwt.at == currentmap->gamestart() && c->cpdist < INFD ? c->cpdist :  | ||||||
|  |         celldistance(c, distance_from == dfPlayer ? cwt.at : currentmap->gamestart()); | ||||||
|       dc = (d != cd) ? 0xFF0000 : 0x00FF00; |       dc = (d != cd) ? 0xFF0000 : 0x00FF00; | ||||||
|       label = its(d); |       label = its(d); | ||||||
|       } |       } | ||||||
| @@ -492,6 +494,9 @@ void viewdist_configure_dialog() { | |||||||
|     dialog::editNumber(first_distance, 0, 3000, 0, 1, "display distances from", ""); |     dialog::editNumber(first_distance, 0, 3000, 0, 1, "display distances from", ""); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  |   dialog::addItem("disable", 'x'); | ||||||
|  |   dialog::add_action([] () { viewdists = false; }); | ||||||
|  |    | ||||||
|   int id = 0; |   int id = 0; | ||||||
|   for(auto& lp: linepatterns::patterns) { |   for(auto& lp: linepatterns::patterns) { | ||||||
|     using namespace linepatterns; |     using namespace linepatterns; | ||||||
| @@ -669,17 +674,18 @@ int readArgs() { | |||||||
|   else if(argis("-vap")) {  |   else if(argis("-vap")) {  | ||||||
|     PHASEFROM(2);  |     PHASEFROM(2);  | ||||||
|     start_game(); |     start_game(); | ||||||
|  |     shift(); int radius = argi(); | ||||||
|     while(true) { |     while(true) { | ||||||
|       string s = expansion.approximate_descendants(10000, 100); |       string s = expansion.approximate_descendants(radius, 100); | ||||||
|       printf("s = %s\n", s.c_str()); |       printf("s = %s\n", s.c_str()); | ||||||
|       if(isize(expansion.descendants) >= 10000) break; |       if(isize(expansion.descendants) >= radius) break; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   else if(argis("-csizes")) {  |   else if(argis("-csizes")) {  | ||||||
|     PHASEFROM(2);  |     PHASEFROM(2);  | ||||||
|     start_game(); |     start_game(); | ||||||
|     expansion.get_growth(); |     expansion.get_growth(); | ||||||
|     for(int i=0; i<30; i++) |     shift(); for(int i=0; i<argi(); i++) | ||||||
|       printf("%s / %s\n", expansion.get_descendants(i).get_str(1000).c_str(), expansion.get_descendants(i, expansion.diskid).get_str(1000).c_str());   |       printf("%s / %s\n", expansion.get_descendants(i).get_str(1000).c_str(), expansion.get_descendants(i, expansion.diskid).get_str(1000).c_str());   | ||||||
|     } |     } | ||||||
|   else if(argis("-csolve")) {  |   else if(argis("-csolve")) {  | ||||||
| @@ -688,9 +694,19 @@ int readArgs() { | |||||||
|     printf("preliminary_grouping...\n"); |     printf("preliminary_grouping...\n"); | ||||||
|     expansion.preliminary_grouping(); |     expansion.preliminary_grouping(); | ||||||
|     printf("N = %d\n", expansion.N); |     printf("N = %d\n", expansion.N); | ||||||
|  |     for(int i=0; i<expansion.N; i++) { | ||||||
|  |       printf("%d:", i); | ||||||
|  |       for(int c: expansion.children[i]) printf(" %d", c); | ||||||
|  |       printf("\n"); | ||||||
|  |       } | ||||||
|     printf("reduce_grouping...\n"); |     printf("reduce_grouping...\n"); | ||||||
|     expansion.reduce_grouping(); |     expansion.reduce_grouping(); | ||||||
|     printf("N = %d\n", expansion.N); |     printf("N = %d\n", expansion.N); | ||||||
|  |     for(int i=0; i<expansion.N; i++) { | ||||||
|  |       printf("%d:", i); | ||||||
|  |       for(int c: expansion.children[i]) printf(" %d", c); | ||||||
|  |       printf("\n"); | ||||||
|  |       } | ||||||
|     printf("growth = %lf\n", (double) expansion.get_growth()); |     printf("growth = %lf\n", (double) expansion.get_growth()); | ||||||
|     expansion.find_coefficients();       |     expansion.find_coefficients();       | ||||||
|     if(expansion.coefficients_known == 2) { |     if(expansion.coefficients_known == 2) { | ||||||
| @@ -718,6 +734,13 @@ int readArgs() { | |||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |   else if(argis("-expansion")) { | ||||||
|  |     cheat(); viewdists = true; | ||||||
|  |     shift(); distance_from = (eDistanceFrom) argi(); | ||||||
|  |     shift(); number_coding = (eNumberCoding) argi(); | ||||||
|  |     shift(); use_color_codes = argi() & 1; use_analyzer = argi() & 2; show_distance_lists = argi() & 4; | ||||||
|  |     } | ||||||
|   else return 1; |   else return 1; | ||||||
|   return 0; |   return 0; | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue