User:PythonshellDebugwindow/RandomNameGenerator

From Esolang
Jump to navigation Jump to search

This JavaScript program will output ten random letter combinations with a length of 5 to 8 characters.

function gen(n) {
    var res = "";
    for(var i = 0; i < n; i++) {
        res += "abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random() * 26)];
    }
    return res;
}
for(var i = 0; i < 10; i++) {
    console.log(gen(Math.floor(Math.random() * 4) + 5));
}

Try it online!

I've made another program that always generates words with at least 2 vowels. Try it online!

Another program of mine generates random words according to a syllable structure (e.g., CVC) and a mapping for each character in the syllable structure (e.g., C for consonants, V for vowels). With the right parameters, at least 1 in 10 words should be nearly pronounceable. Try it online!