mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 22:12:59 +00:00 
			
		
		
		
	binary:: celldistance3_approx works without cells too
This commit is contained in:
		| @@ -819,8 +819,13 @@ int celldistance3_approx(heptagon *c1, heptagon *c2) { | |||||||
|   while(true) { |   while(true) { | ||||||
|     if(d > 1000000) return d; /* sanity check */ |     if(d > 1000000) return d; /* sanity check */ | ||||||
|     if(c1 == c2) return d; |     if(c1 == c2) return d; | ||||||
|     if(neighborId(c1->c7, c2->c7) >= 0) return d + 1; |     for(int i=0; i<c1->type; i++) | ||||||
|     forCellEx(c3, c1->c7) if(neighborId(c3, c2->c7) >= 0) return d + 2; |       if(c1->move(i) == c2) return d + 1; | ||||||
|  |     for(int i=0; i<c1->type; i++) { | ||||||
|  |       heptagon *c3 = c1->move(i); | ||||||
|  |       for(int j=0; j<c3->type; j++) | ||||||
|  |         if(c3->move(j) == c2) return d+2; | ||||||
|  |         } | ||||||
|     if(c1->distance > c2->distance) c1=c1->cmove(updir()), d++; |     if(c1->distance > c2->distance) c1=c1->cmove(updir()), d++; | ||||||
|     else c2=c2->cmove(updir()), d++; |     else c2=c2->cmove(updir()), d++; | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue