Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pronounceable Seeded Name Generator
function name (id, l) {
function n(){return id=(399*id)%509}
var r="BDGKNPTVZ"[n()%9]
for (var i=1;i<l;i++) r+=i%2?"aeiou"[n()%5]:"bdgknptvz"[n()%9]
return r
};
// id=seed, l=length
function name (id, l) {
// lcg prng
function n(){return id=(399*id)%509}
// first letter (capitalize)
var r="BDGKNPTVZ"[n()%9]
for (var i=1;i<l;i++)
// if i is odd, add a vowel; otherwise add a consonant
r+=i%2?"aeiou"[n()%5]:"bdgknptvz"[n()%9]
// return
return r
};
// tests
console.log(name(1,5))
console.log(name(2,5))
console.log(name(3,7))
@sbrl
Copy link

sbrl commented May 21, 2015

Examples:

Kozik
Divut
Zetibib
Tapukun
Tagibup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment