Skip to content

Instantly share code, notes, and snippets.

@lxe
Created April 5, 2013 21:45
Show Gist options
  • Save lxe/5322893 to your computer and use it in GitHub Desktop.
Save lxe/5322893 to your computer and use it in GitHub Desktop.
var generateForeignName = function() {
return [2, 4].map(function(numSyls) {
var i = Math.floor(Math.random() * numSyls) + 2
, syl = 'bdfghklmnprstj'
, vow = 'aouei'
, name = '';
while (i--) {
name += syl[Math.floor(Math.random() * (syl.length - i))];
name += vow[Math.floor(Math.random() * (vow.length - i))];
}
return name[0].toUpperCase() + name.slice(1);
}).join(' ');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment