drWhoIceWarriorNames.js (1823B)
1 var nm1 = ["h", "gr", "g", "gl", "k", "kr", "kl", "r", "sk", "sl", "ss", "sr", "sz", "v", "vr", "xz", "x", "xr", "xzn", "z"]; 2 var nm2 = ["a", "i", "o", "e", "aa", "a", "u", "a", "y", "a"]; 3 var nm3 = ["d", "dr", "kss", "ld", "m", "nt", "r", "rt", "rd", "rn", "rg", "sb", "sr", "sz", "szr", "zr", "ssb", "x", "xl", "z", "zd"]; 4 var nm4 = ["d", "dz", "k", "kz", "l", "lk", "n", "r", "rd", "rzz", "rz", "rs", "x", "z"]; 5 var nm5 = ["a", "", "", "", "", "", ""]; 6 7 function nameGen() { 8 $('#placeholder').css('textTransform', 'capitalize'); 9 var br = ""; 10 var element = document.createElement("div"); 11 element.setAttribute("id", "result"); 12 for (i = 0; i < 10; i++) { 13 if (i < 5) { 14 rnd = Math.floor(Math.random() * nm5.length); 15 rnd2 = Math.floor(Math.random() * nm1.length); 16 rnd3 = Math.floor(Math.random() * nm2.length); 17 rnd4 = Math.floor(Math.random() * nm3.length); 18 rnd5 = Math.floor(Math.random() * nm2.length); 19 rnd6 = Math.floor(Math.random() * nm4.length); 20 names = nm5[rnd] + nm1[rnd2] + nm2[rnd3] + nm3[rnd4] + nm2[rnd5] + nm4[rnd6]; 21 } else { 22 rnd = Math.floor(Math.random() * nm5.length); 23 rnd2 = Math.floor(Math.random() * nm1.length); 24 rnd3 = Math.floor(Math.random() * nm2.length); 25 rnd6 = Math.floor(Math.random() * nm4.length); 26 names = nm5[rnd] + nm1[rnd2] + nm2[rnd3] + nm4[rnd6]; 27 } 28 br = document.createElement('br'); 29 element.appendChild(document.createTextNode(names)); 30 element.appendChild(br); 31 } 32 if (document.getElementById("result")) { 33 document.getElementById("placeholder").removeChild(document.getElementById("result")); 34 } 35 document.getElementById("placeholder").appendChild(element); 36 }