rattatakiNames.js (2487B)
1 var nm1 = ["a", "e", "i", "o", "u", "ai", "au", "ei", "ou", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 2 var nm2 = ["b", "br", "bz", "bj", "c", "cz", "ch", "d", "dj", "dz", "g", "gr", "h", "j", "k", "kz", "kr", "p", "pr", "pj", "pz", "q", "r", "sj", "st", "sr", "t", "ts", "tr", "v", "wr", "x", "xj", "xr", "yj", "yr", "ys", "yz", "z", "zr"]; 3 var nm3 = ["i", "a", "o", "e", "u"]; 4 var nm4 = ["c", "ch", "dj", "g", "gr", "h", "k", "m", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"]; 5 var nm5 = ["c", "ch", "dj", "g", "gr", "h", "k", "m", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z", "i", "o", "u", "", "", "", "", "", "", "", ""]; 6 var nm6 = ["a", "e", "i", "o", "u", "ai", "au", "ei", "ou", "ay", "ey", "oy", "", "", "", "", "", "", "", "", "", "", "", ""]; 7 var nm7 = ["b", "br", "bj", "c", "cz", "ch", "d", "dj", "dz", "g", "h", "j", "k", "kz", "l", "m", "n", "p", "pr", "pj", "q", "r", "s", "sj", "st", "sr", "t", "ts", "tr", "v", "w", "wr", "x", "xj", "xr", "y", "yj", "yr", "ys", "yz", "z", "zr"]; 8 var nm8 = ["i", "a", "o", "e", "u", "ie", "ai", "ey", "ay"]; 9 var br = ""; 10 11 function nameGen(type) { 12 $('#placeholder').css('textTransform', 'capitalize'); 13 var tp = type; 14 var element = document.createElement("div"); 15 element.setAttribute("id", "result"); 16 for (i = 0; i < 10; i++) { 17 rnd3 = Math.floor(Math.random() * nm3.length); 18 rnd4 = Math.floor(Math.random() * nm4.length); 19 rnd5 = Math.floor(Math.random() * nm5.length); 20 if (tp === 1) { 21 rnd6 = Math.floor(Math.random() * nm6.length); 22 rnd7 = Math.floor(Math.random() * nm7.length); 23 rnd8 = Math.floor(Math.random() * nm8.length); 24 names = nm6[rnd6] + nm7[rnd7] + nm8[rnd8] + nm4[rnd4] + nm3[rnd3] + nm5[rnd5]; 25 } else { 26 rnd6 = Math.floor(Math.random() * nm1.length); 27 rnd7 = Math.floor(Math.random() * nm2.length); 28 rnd8 = Math.floor(Math.random() * nm3.length); 29 names = nm1[rnd6] + nm2[rnd7] + nm3[rnd8] + nm4[rnd4] + nm3[rnd3] + nm5[rnd5]; 30 } 31 br = document.createElement('br'); 32 element.appendChild(document.createTextNode(names)); 33 element.appendChild(br); 34 } 35 if (document.getElementById("result")) { 36 document.getElementById("placeholder").removeChild(document.getElementById("result")); 37 } 38 document.getElementById("placeholder").appendChild(element); 39 }