Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import sys
- vowels = ['a', 'e', 'i', 'o', 'u']
- consonants = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']
- hexchar = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']
- def _vowel():
- return random.choice(vowels)
- def _consonant():
- return random.choice(consonants)
- def _cv():
- return _consonant() + _vowel()
- def _cvc():
- return _cv() + _consonant()
- def _syllable():
- return random.choice([_vowel, _cv, _cvc])()
- def create_fake_word():
- """ This function generates a fake word by creating between two and three
- random syllables and then joining them together.
- """
- syllables = []
- for x in range(random.randint(3,5)):
- syllables.append(_syllable())
- return ''.join(syllables)
- def _hexchar():
- return random.choice(hexchar)
- def colorval():
- colorvalues = []
- for x in range(0,6):
- colorvalues.append(_hexchar())
- return ''.join(colorvalues)
- if __name__ == '__main__':
- filename = str.capitalize(create_fake_word())
- filename += 'Config.ini'
- fo = open(filename, 'wb')
- biomesize = 'BiomeSize:'
- biomesize += str(random.randint(3,10))
- fo.write(biomesize)
- fo.write('\n')
- biomerarity = 'BiomeRarity:'
- biomerarity += str(random.randint(25,75))
- fo.write(biomerarity)
- fo.write('\n')
- fo.write('BiomeIsBorder:')
- fo.write('\n')
- fo.write('NotBorderNear:')
- fo.write('\n')
- biometemperature = 'BiomeTemperature:'
- biometemperature += str(round(random.uniform(0.0, 1.1), 1))
- fo.write(biometemperature)
- fo.write('\n')
- biomewetness = 'BiomeWetness:'
- biomewetness += str(round(random.uniform(0.0, 1.1), 1))
- fo.write(biomewetness)
- fo.write('\n')
- biomeheight = 'BiomeHeight:'
- biomeheight += str(round(random.gauss(-10.0, 10.1), 1))
- fo.write(biomeheight)
- fo.write('\n')
- biomevolatility = 'BiomeVolatility:'
- biomevolatility += str(round(random.gauss(0.0,1.1),1))
- fo.write(biomevolatility)
- fo.write('\n')
- fo.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement