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.

146 lines
5.9 KiB
JavaScript

var nm1 = ["", "", "", "b", "d", "g", "h", "j", "k", "l", "n", "p", "r", "s", "sh", "t", "v"];
var nm2 = ["aa", "ii", "a", "a", "e", "i", "o", "o", "a", "a", "e", "i", "o", "o", "a", "a", "e", "i", "o", "o"];
var nm3 = ["b", "br", "dr", "g", "gg", "gr", "k", "kk", "kl", "l", "lm", "lv", "m", "mm", "ms", "mz", "n", "nd", "nj", "nt", "rg", "st", "v"];
var nm4 = ["a", "a", "e", "i", "o", "o", "u", "u"];
var nm5 = ["l", "ll", "n", "r", "rr", "s", "z"];
var nm6 = ["", "", "", "h", "k", "m", "n", "r", "s"];
var nm7 = ["", "", "", "b", "d", "h", "k", "l", "n", "m", "s", "t", "v"];
var nm8 = ["a", "a", "a", "e", "i", "i", "o", "u"];
var nm9 = ["d", "k", "kk", "l", "ll", "lr", "ldr", "lj", "ln", "lm", "m", "mm", "mn", "n", "nd", "nj", "nn", "nr", "r", "rl", "rn", "rm", "rz", "shr", "sh", "z", "zz"];
var nm10 = ["ia", "ea", "oa", "io", "y", "a", "a", "a", "e", "i", "o", "o", "a", "a", "a", "e", "i", "o", "o", "a", "a", "a", "e", "i", "o", "o"];
var nm11 = ["h", "l", "n", "s", "sh"];
var nm11b = ["a", "e", "i", "a", "e", "o"];
var nm11c = ["", "", "", "", "", "", "", "", "h", "l", "n", "r"];
var nm12 = ["", "", "b", "d", "g", "h", "j", "k", "n", "p", "r", "t", "v"];
var nm13 = ["aa", "oa", "a", "e", "o", "a", "o", "a", "e", "o", "a", "o", "i", "a", "e", "o", "a", "o", "i", "u", "i"];
var nm14 = ["dr", "m", "n", "nd", "nr", "nv", "nt", "r", "rr", "rt", "rv", "sh", "sz", "t", "th", "tr", "th", "v", "vr"];
var nm15 = ["ee", "y", "a", "a", "e", "i", "o", "u", "a", "a", "e", "i", "o", "u"];
var nm16 = ["d", "g", "h", "j", "r", "v", "z"];
var nm17 = ["a", "e", "i"];
var nm18 = ["", "", "", "", "", "", "d", "dd", "p", "ph", "r", "rr", "s", "sh", "ss"];
var br = "";
function nameGen(type) {
var tp = type;
$('#placeholder').css('textTransform', 'capitalize');
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
nameSur();
while (nSr === "") {
nameSur();
}
if (tp === 1) {
nameFem();
while (nMs === "") {
nameFem();
}
} else {
nameMas();
while (nMs === "") {
nameMas();
}
}
names = nMs + " " + nSr;
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);
}
function nameMas() {
nTp = Math.random() * 5 | 0;
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
rnd3 = Math.random() * nm6.length | 0;
if (nTp === 0) {
while (nm1[rnd] === "") {
rnd = Math.random() * nm1.length | 0;
}
while (nm1[rnd] === nm6[rnd3] || nm6[rnd3] === "") {
rnd3 = Math.random() * nm6.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm6[rnd3];
} else {
rnd4 = Math.random() * nm3.length | 0;
rnd5 = Math.random() * nm4.length | 0;
while (nm3[rnd4] === nm1[rnd] || nm3[rnd4] === nm6[rnd3]) {
rnd4 = Math.random() * nm3.length | 0;
}
while (rnd2 < 4 && rnd5 < 4) {
rnd5 = Math.random() * nm4.length | 0;
}
if (nTp < 4) {
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm6[rnd3];
} else {
rnd6 = Math.random() * nm5.length | 0;
rnd7 = Math.random() * nm4.length | 0;
while (nm3[rnd4] === nm5[rnd6] || nm5[rnd6] === nm6[rnd3]) {
rnd6 = Math.random() * nm5.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm5[rnd6] + nm4[rnd7] + nm6[rnd3];
}
}
testSwear(nMs);
}
function nameFem() {
nTp = Math.random() * 3 | 0;
rnd = Math.random() * nm7.length | 0;
rnd2 = Math.random() * nm8.length | 0;
rnd3 = Math.random() * nm9.length | 0;
rnd4 = Math.random() * nm10.length | 0;
rnd5 = Math.random() * nm11c.length | 0;
while (nm9[rnd3] === nm7[rnd] || nm9[rnd3] === nm11c[rnd5]) {
rnd3 = Math.random() * nm9.length | 0;
}
if (nTp < 2) {
nMs = nm7[rnd] + nm8[rnd2] + nm9[rnd3] + nm10[rnd4] + nm11c[rnd5];
} else {
rnd6 = Math.random() * nm11.length | 0;
rnd7 = Math.random() * nm11b.length | 0;
while (nm9[rnd3] === nm11[rnd6] || nm11[rnd6] === nm11c[rnd5]) {
rnd6 = Math.random() * nm11.length | 0;
}
nMs = nm7[rnd] + nm8[rnd2] + nm9[rnd3] + nm10[rnd4] + nm11[rnd6] + nm11b[rnd7] + nm11c[rnd5];
}
testSwear(nMs);
}
function nameSur() {
nTp = Math.random() * 4 | 0;
rnd = Math.random() * nm12.length | 0;
rnd2 = Math.random() * nm13.length | 0;
rnd3 = Math.random() * nm18.length | 0;
if (nTp === 0) {
while (nm18[rnd3] === "" && rnd2 > 1) {
rnd3 = Math.random() * nm18.length | 0;
}
while (nm12[rnd] === nm18[rnd3] || nm12[rnd] === "") {
rnd = Math.random() * nm12.length | 0;
}
nSr = nm12[rnd] + nm13[rnd2] + nm18[rnd3];
} else {
rnd4 = Math.random() * nm14.length | 0;
rnd5 = Math.random() * nm15.length | 0;
while (nm14[rnd4] === nm12[rnd] || nm14[rnd4] === nm18[rnd3]) {
rnd4 = Math.random() * nm14.length | 0;
}
if (nTp < 3) {
nSr = nm12[rnd] + nm13[rnd2] + nm14[rnd4] + nm15[rnd5] + nm18[rnd3];
} else {
rnd6 = Math.random() * nm16.length | 0;
rnd7 = Math.random() * nm17.length | 0;
while (nm14[rnd4] === nm16[rnd6] || nm16[rnd6] === nm18[rnd3]) {
rnd6 = Math.random() * nm16.length | 0;
}
nSr = nm12[rnd] + nm13[rnd2] + nm14[rnd4] + nm15[rnd5] + nm16[rnd6] + nm17[rnd7] + nm18[rnd3];
}
}
testSwear(nSr);
}