Created
October 27, 2015 19:11
-
-
Save JosephCatrambone/e9a264ed7213d8b31079 to your computer and use it in GitHub Desktop.
A way to generate planetary/system names from numbers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lookup = ['Aleph', 'Alpha', 'Antares', 'Beta', 'Bootes', 'Barum', 'Ceres', 'Charion', 'Chardibus', 'Chalupa', 'Delta', 'Darion', 'Doolan', 'Echo', 'Eres', 'Eribus', 'Encephalus', 'Ender', 'Foxtrot', 'Famicom', 'Gamma', 'Gregorio', 'Grace', 'Gaea', 'Gaia', 'Howzer', 'Hera', 'Hosio', 'Ignus', 'Io', 'Ionus', 'Ibus', 'Jax', 'Jovia', 'Jolo', 'Keras', 'Kodia', 'Li', 'Libra', 'Lol', 'Orphius', 'Orchid', 'Odyssus', 'Persephone', 'Pax', 'Qualude', 'Qi', 'Ra', 'Rez', 'Radium', 'Tia', 'Tori', 'Uso', 'Ura', 'Varia', 'Verit', 'Wex', 'Woolio', 'X', 'Yota', 'Yttrius', 'Zoe', 'Zee', 'Zae', 'Zeebs'] | |
def from_int(num): | |
base = len(lookup) # Base whatever. | |
name = list() | |
while num > 0: | |
digit = num%base | |
num = num//base | |
name.append(lookup[digit]) | |
string = "" | |
string += "{} supercluster. ".format(name.pop()) | |
string += "{} group. ".format(name.pop()) | |
string += "{} system. ".format(name.pop()) | |
string += "-".join(name) | |
return string | |
#Examples: | |
#In [30]: from_int(15620) | |
#Out[30]: 'Beta supercluster. Qualude group. Gamma system. ' | |
#In [31]: from_int(156200185) | |
#Out[31]: 'Chardibus supercluster. Rez group. Tia system. Tia-Io' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment