v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Quietust/utterance.py

From Dwarf Fortress Wiki
< User:Quietust
Revision as of 22:08, 24 September 2024 by Quietust (talk | contribs) (Kobold Utterance generator, based on disassembly of version 0.28.181.40d (and rechecked against various other releases))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#!/usr/bin/python3
import random

def utterance():
	name = ""
	vowel = random.choice(["a","i","o","u"])
	len = random.randrange(1,4)
	firstSyl = True
	while len > 0:
		if len == 1:
			vowel = random.choice(["a","o","u","ay","ee","i"])
		if len == 1 or firstSyl:
			name += random.choice(["b","br","bl","d","dr","dl","st","str","stl","sh","shr","shl","s","sr","sl","t","tr","tl","th","thr","thl","ch","chr","chl","l","lr","f","fr","fl","g","gr","gl","k","kr","kl","p","pr","pl","j","jr","jl"])
			firstSyl = False
		else:
			name += random.choice(["b","d","l","f","g","k"])
		name += vowel
		len -= 1
	name += random.choice(["m","r","ng","b","rb","mb","g","lg","l","lb","lm","k","nk","ld","d","rsn"])
	if vowel in ["o","ay","u","a"]:
		name += random.choice(["is","us","er","in"])
	else:
		name += random.choice(["is","us"])
	return name

for x in range(0,100):
	print(utterance().title())