You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
2.1 KiB
JavaScript

var nm1 = ["B", "D", "G", "K", "M", "N", "R", "T"];
var nm2 = ["a", "e", "i", "o", "u", "a", "o"];
var nm3 = ["b", "br", "bl", "d", "dr", "dl", "g", "gr", "gl", "gg", "g", "gr", "gl", "gg", "g", "gr", "gl", "gg", "g", "gr", "gl", "gg", "l", "lg", "lb", "ld", "m", "mr", "md", "mb", "n", "nd", "nl", "nb", "ng", "r", "rb", "rg", "rd", "rk", "rm", "rtr", "t", "z", "kb", "kl", "km", "kn", "kd", "b", "d", "g", "k", "l", "m", "n", "r", "t", "z", "b", "d", "g", "k", "l", "m", "n", "r", "t", "z", "b", "d", "g", "k", "l", "m", "n", "r", "t", "z", "b", "d", "g", "k", "l", "m", "n", "r", "t", "z", "b", "d", "g", "k", "l", "m", "n", "r", "t", "z"];
var nm4 = ["", "", "", "", "", "", "", "", "", "", "", "", "k", "g", "ck", "gs", "m", "n", "s"];
var br = "";
function nameGen() {
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
rnd = Math.floor(Math.random() * nm1.length);
rnd2 = Math.floor(Math.random() * nm2.length);
rnd3 = Math.floor(Math.random() * nm3.length);
rnd4 = Math.floor(Math.random() * nm4.length);
rnd5 = Math.floor(Math.random() * nm2.length);
if (i < 4) {
names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd5] + nm4[rnd4];
} else {
rnd6 = Math.floor(Math.random() * nm3.length);
rnd7 = Math.floor(Math.random() * nm2.length);
names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd5] + nm3[rnd6] + nm2[rnd7] + nm4[rnd4];
if (i > 7) {
rnd8 = Math.floor(Math.random() * nm3.length);
rnd9 = Math.floor(Math.random() * nm2.length);
names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd5] + nm3[rnd6] + nm2[rnd7] + nm3[rnd8] + nm2[rnd9] + nm4[rnd4];
}
}
br = document.createElement('br');
element.appendChild(document.createTextNode(names));
element.appendChild(br);
}
if (document.getElementById("result")) {
document.getElementById("placeholder").removeChild(document.getElementById("result"));
}
document.getElementById("placeholder").appendChild(element);
}