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.
132 lines
5.0 KiB
JavaScript
132 lines
5.0 KiB
JavaScript
var nm1 = ["", "", "", "br", "d", "dr", "g", "gr", "h", "n", "p", "r", "s", "v", "z"];
|
|
var nm2 = ["a", "e", "o", "a", "e", "o", "i", "u"];
|
|
var nm3 = ["d", "dh", "g", "l", "lh", "m", "n", "r", "s", "t", "tt", "v"];
|
|
var nm4 = ["a", "e", "i", "o"];
|
|
var nm5 = ["", "", "", "c", "d", "l", "m", "n", "s"];
|
|
var nm6 = ["", "", "", "", "c", "cr", "d", "h", "j", "k", "kr", "l", "m", "n", "r", "v"];
|
|
var nm7 = ["ai", "a", "e", "o", "a", "e", "i", "a", "e", "o", "a", "e", "i"];
|
|
var nm8 = ["d", "dh", "dz", "gn", "l", "ld", "ln", "m", "mn", "n", "nd", "ny", "nz", "sh", "st", "t", "th", "z", "zr"];
|
|
var nm9 = ["ia", "ai", "aa", "a", "o", "a", "o", "i", "e", "a", "o", "a", "o", "i", "e"];
|
|
var nm10 = ["d", "dr", "l", "ld", "ln", "m", "mn", "n", "nd", "ns", "nz", "z"];
|
|
var nm11 = ["a", "a", "e", "o", "a", "a", "e", "o", "i"];
|
|
var nm12 = ["h", "", "", "", "", "", "", "", "", "", ""];
|
|
var nm13 = ["", "", "", "", "b", "d", "l", "m", "n", "r", "v", "z"];
|
|
var nm14 = ["oo", "uu", "ou", "a", "o", "a", "o", "u", "a", "o", "a", "o", "u", "e", "i"];
|
|
var nm15 = ["d", "dr", "g", "gd", "gr", "k", "kk", "kr", "ld", "lj", "lk", "lv", "nd", "nk", "r", "rg", "rk", "z", "zz"];
|
|
var nm16 = ["a", "e", "i", "e", "i"];
|
|
var nm17 = ["", "", "", "", "d", "h", "m", "n", "r", "s", "ss", "d", "dd", "h", "m", "n", "nd", "r", "rm", "rn", "s", "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() * 3 | 0;
|
|
rnd = Math.random() * nm1.length | 0;
|
|
rnd2 = Math.random() * nm2.length | 0;
|
|
rnd3 = Math.random() * nm5.length | 0;
|
|
if (nTp === 0) {
|
|
while (nm5[rnd3] === "") {
|
|
rnd3 = Math.random() * nm5.length | 0;
|
|
}
|
|
while (nm1[rnd] === nm5[rnd3] || nm1[rnd] === "") {
|
|
rnd = Math.random() * nm1.length | 0;
|
|
}
|
|
nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
|
|
} else {
|
|
rnd4 = Math.random() * nm3.length | 0;
|
|
rnd5 = Math.random() * nm4.length | 0;
|
|
while (nm3[rnd4] === nm1[rnd] || nm3[rnd4] === nm5[rnd3]) {
|
|
rnd4 = Math.random() * nm3.length | 0;
|
|
}
|
|
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm5[rnd3];
|
|
}
|
|
testSwear(nMs);
|
|
}
|
|
|
|
function nameFem() {
|
|
nTp = Math.random() * 5 | 0;
|
|
rnd = Math.random() * nm6.length | 0;
|
|
rnd2 = Math.random() * nm7.length | 0;
|
|
rnd3 = Math.random() * nm12.length | 0;
|
|
if (nTp === 0) {
|
|
while (nm6[rnd] === nm12[rnd3]) {
|
|
rnd3 = Math.random() * nm12.length | 0;
|
|
}
|
|
nMs = nm6[rnd] + nm7[rnd2] + nm12[rnd3];
|
|
} else {
|
|
rnd4 = Math.random() * nm8.length | 0;
|
|
rnd5 = Math.random() * nm9.length | 0;
|
|
while (nm8[rnd4] === nm6[rnd] || nm8[rnd4] === nm12[rnd3]) {
|
|
rnd4 = Math.random() * nm8.length | 0;
|
|
}
|
|
while (rnd2 === 0 && rnd5 < 3) {
|
|
rnd5 = Math.random() * nm9.length | 0;
|
|
}
|
|
if (nTp < 4) {
|
|
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd4] + nm9[rnd5] + nm12[rnd3];
|
|
} else {
|
|
rnd6 = Math.random() * nm10.length | 0;
|
|
rnd7 = Math.random() * nm11.length | 0;
|
|
while (nm8[rnd4] === nm10[rnd6] || nm10[rnd6] === nm12[rnd3]) {
|
|
rnd6 = Math.random() * nm10.length | 0;
|
|
}
|
|
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd4] + nm9[rnd5] + nm10[rnd6] + nm11[rnd7] + nm12[rnd3];
|
|
}
|
|
}
|
|
testSwear(nMs);
|
|
}
|
|
|
|
function nameSur() {
|
|
nTp = Math.random() * 3 | 0;
|
|
rnd = Math.random() * nm13.length | 0;
|
|
rnd2 = Math.random() * nm14.length | 0;
|
|
rnd3 = Math.random() * nm17.length | 0;
|
|
if (nTp === 0) {
|
|
while (nm17[rnd3] === "") {
|
|
rnd3 = Math.random() * nm17.length | 0;
|
|
}
|
|
while (nm13[rnd] === nm17[rnd3] || nm13[rnd] === "") {
|
|
rnd = Math.random() * nm13.length | 0;
|
|
}
|
|
nSr = nm13[rnd] + nm14[rnd2] + nm17[rnd3];
|
|
} else {
|
|
rnd4 = Math.random() * nm15.length | 0;
|
|
rnd5 = Math.random() * nm16.length | 0;
|
|
while (nm15[rnd4] === nm13[rnd] || nm15[rnd4] === nm17[rnd3]) {
|
|
rnd4 = Math.random() * nm15.length | 0;
|
|
}
|
|
nSr = nm13[rnd] + nm14[rnd2] + nm15[rnd4] + nm16[rnd5] + nm17[rnd3];
|
|
}
|
|
testSwear(nSr);
|
|
}
|