mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	index_pointer now produces better sequences of chars
This commit is contained in:
		| @@ -48,10 +48,13 @@ EX map<void*, int> pointer_indices; | |||||||
|  |  | ||||||
| EX string index_pointer(void *v) { | EX string index_pointer(void *v) { | ||||||
|   if(v == nullptr) return "0"; |   if(v == nullptr) return "0"; | ||||||
|   if(!pointer_indices.count(v)) pointer_indices[v] = isize(pointer_indices); |   if(!pointer_indices.count(v)) { | ||||||
|  |     int s = isize(pointer_indices); | ||||||
|  |     pointer_indices[v] = s; | ||||||
|  |     } | ||||||
|  |   int i = pointer_indices[v]; | ||||||
|   string res; |   string res; | ||||||
|   int i = pointer_indices[v] + 1; |   while(true) { res += ('A' + (i % 26)); i /= 26; if(!i) break; i--; } | ||||||
|   while(i) { res += ('A' + (i % 26)); i /= 26; } |  | ||||||
|   return res; |   return res; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue