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.

73 lines
2.7 KiB
JavaScript

var nm1 = ["Fh", "H", "K", "L", "M", "N", "R", "T", "V"];
var nm2 = ["a", "e", "o", "u"];
var nm3 = ["d", "l", "n", "r"];
var nm4 = ["a", "e", "o"];
var nm5 = ["", "l", "m", "n", "n", "n", "r", "r", "r"];
var nm6 = ["D", "F", "K", "L", "P", "S", "V"];
var nm7 = ["a", "e", "a", "e", "o", "u", "aa", "oo", "eu", "uu"];
var nm8 = ["d", "k", "l", "ll", "r", "v", "vv"];
var nm9 = ["H", "K", "N", "P", "R", "S", "T", "V"];
var nm10 = ["aa", "oo", "a", "e", "o"];
var nm11 = ["d", "dd", "l", "ll", "n", "nn", "r", "rr", "v", "vv", "z", "zz"];
var nm12 = ["a", "e"];
var nm13 = ["k", "l", "ln", "lm", "m", "n", "r", "rk", "rn"];
var br = "";
function nameGen() {
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
nameMas();
while (nMs === "") {
nameMas();
}
br = document.createElement('br');
element.appendChild(document.createTextNode(nMs));
element.appendChild(br);
}
if (document.getElementById("result")) {
document.getElementById("placeholder").removeChild(document.getElementById("result"));
}
document.getElementById("placeholder").appendChild(element);
}
function nameMas() {
nTp = Math.random() * 6 | 0;
if (nTp < 4) {
rnd2 = Math.random() * nm2.length | 0;
rnd3 = Math.random() * nm6.length | 0;
rnd4 = Math.random() * nm7.length | 0;
rnd5 = Math.random() * nm8.length | 0;
if (nTp < 2) {
rnd6 = Math.random() * nm3.length | 0;
rnd7 = Math.random() * nm4.length | 0;
nMs = nm2[rnd2].toUpperCase() + nm3[rnd6] + nm4[rnd7] + nm6[rnd3] + nm7[rnd4] + nm8[rnd5];
} else {
rnd = Math.random() * nm1.length | 0;
rnd7 = Math.random() * nm5.length | 0;
while (nm1[rnd] === nm6[rnd3]) {
rnd = Math.random() * nm1.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd7] + nm6[rnd3] + nm7[rnd4] + nm8[rnd5];
}
} else {
rnd = Math.random() * nm9.length | 0;
rnd2 = Math.random() * nm10.length | 0;
rnd3 = Math.random() * nm13.length | 0;
if (nTp === 4) {
while (nm9[rnd] === nm13[rnd3]) {
rnd3 = Math.random() * nm13.length | 0;
}
nMs = nm9[rnd] + nm10[rnd2] + nm13[rnd3];
} else {
rnd4 = Math.random() * nm11.length | 0;
rnd5 = Math.random() * nm12.length | 0;
while (nm9[rnd] === nm11[rnd4] || nm11[rnd4] === nm13[rnd3]) {
rnd4 = Math.random() * nm11.length | 0;
}
nMs = nm9[rnd] + nm10[rnd2] + nm11[rnd4] + nm12[rnd5] + nm13[rnd3];
}
}
testSwear(nMs);
}