zeldaMinishNames.js (1025B)
1 var nm1 = ["B", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "T"]; 2 var nm2 = ["e", "i", "o", "e", "i", "o", "a", "u"]; 3 var nm3 = ["b", "d", "f", "g", "k", "l", "m", "n", "p", "r", "s", "t"]; 4 var nm4 = ["ari", "tari", "rari"]; 5 var br = ""; 6 7 function nameGen() { 8 var element = document.createElement("div"); 9 element.setAttribute("id", "result"); 10 for (i = 0; i < 10; i++) { 11 rnd = Math.floor(Math.random() * nm1.length); 12 rnd2 = Math.floor(Math.random() * nm2.length); 13 rnd3 = Math.floor(Math.random() * nm3.length); 14 rnd4 = Math.floor(Math.random() * nm4.length); 15 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4]; 16 br = document.createElement('br'); 17 element.appendChild(document.createTextNode(names)); 18 element.appendChild(br); 19 } 20 if (document.getElementById("result")) { 21 document.getElementById("placeholder").removeChild(document.getElementById("result")); 22 } 23 document.getElementById("placeholder").appendChild(element); 24 }