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.
113 lines
4.2 KiB
JavaScript
113 lines
4.2 KiB
JavaScript
var nm1 = ["b", "d", "dr", "f", "g", "j", "k", "m", "n", "p", "q", "r", "x"];
|
|
var nm2 = ["a", "e", "o", "u", "a", "e", "o"];
|
|
var nm3 = ["b", "bb", "bl", "dd", "dr", "k", "kk", "l", "ld", "ll", "lw", "n", "nn", "nw", "nx", "r", "rp", "rr", "rv", "rw", "v", "vv", "tl", "tt", "tw", "xt", "yk"];
|
|
var nm4 = ["ou", "iu", "a", "e", "i", "a", "e", "i", "a", "e", "i", "a", "e", "i", "a", "e", "i"];
|
|
var nm5 = ["", "", "", "b", "l", "ld", "n", "nd", "r", "rd", "s", "x"];
|
|
var nm6 = ["ch", "f", "h", "l", "m", "n", "s", "sn", "t", "th", "y", "z"];
|
|
var nm7 = ["a", "e", "a", "e", "a", "e", "i", "o"];
|
|
var nm8 = ["d", "g", "n", "r", "s", "t", "v", "z"];
|
|
var nm9 = ["ia", "ya", "ui", "ie", "ei", "a", "e", "i", "a", "e", "i", "o", "u", "a", "e", "i", "a", "e", "i", "o", "u"];
|
|
var nm10 = ["", "", "", "h", "l", "n", "s", "ss", "x"];
|
|
var nm11 = ["", "", "", "b", "d", "j", "g", "gr", "k", "kr", "n", "r", "v", "y", "z"];
|
|
var nm12 = ["a", "e", "i", "u"];
|
|
var nm13 = ["d", "dr", "dd", "gr", "k", "kk", "kt", "kst", "ll", "ldr", "lst", "n", "ndr", "nd", "ngr", "r", "rr", "rl", "rv", "t", "tt", "tr", "ttst"];
|
|
var nm14 = ["e", "i", "e", "i", "a", "o"];
|
|
var nm15 = ["d", "g", "gg", "k", "l", "ll", "r", "s", "x"];
|
|
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 (nMs === "") {
|
|
nameSur();
|
|
}
|
|
names = nMs;
|
|
if (tp === 1) {
|
|
nameFem();
|
|
while (nMs === "") {
|
|
nameFem();
|
|
}
|
|
} else {
|
|
nameMas();
|
|
while (nMs === "") {
|
|
nameMas();
|
|
}
|
|
}
|
|
names = nMs + " " + names;
|
|
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 (nm1[rnd] === nm5[rnd3] || nm5[rnd3] === "") {
|
|
rnd3 = Math.random() * nm5.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() * 3 | 0;
|
|
rnd = Math.random() * nm6.length | 0;
|
|
rnd2 = Math.random() * nm7.length | 0;
|
|
rnd3 = Math.random() * nm10.length | 0;
|
|
if (nTp === 0) {
|
|
while (nm6[rnd] === nm10[rnd3] || nm10[rnd3] === "") {
|
|
rnd3 = Math.random() * nm10.length | 0;
|
|
}
|
|
nMs = nm6[rnd] + nm7[rnd2] + nm10[rnd3];
|
|
} else {
|
|
rnd4 = Math.random() * nm8.length | 0;
|
|
rnd5 = Math.random() * nm9.length | 0;
|
|
while (nm8[rnd4] === nm6[rnd] || nm8[rnd4] === nm10[rnd3]) {
|
|
rnd4 = Math.random() * nm8.length | 0;
|
|
}
|
|
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd4] + nm9[rnd5] + nm10[rnd3];
|
|
}
|
|
testSwear(nMs);
|
|
}
|
|
|
|
function nameSur() {
|
|
nTp = Math.random() * 3 | 0;
|
|
rnd = Math.random() * nm11.length | 0;
|
|
rnd2 = Math.random() * nm12.length | 0;
|
|
rnd3 = Math.random() * nm15.length | 0;
|
|
if (nTp === 0) {
|
|
while (nm11[rnd] === nm15[rnd3] || nm15[rnd3] === "") {
|
|
rnd3 = Math.random() * nm15.length | 0;
|
|
}
|
|
nMs = nm11[rnd] + nm12[rnd2] + nm15[rnd3];
|
|
} else {
|
|
rnd4 = Math.random() * nm13.length | 0;
|
|
rnd5 = Math.random() * nm14.length | 0;
|
|
while (nm13[rnd4] === nm11[rnd] || nm13[rnd4] === nm15[rnd3]) {
|
|
rnd4 = Math.random() * nm13.length | 0;
|
|
}
|
|
nMs = nm11[rnd] + nm12[rnd2] + nm13[rnd4] + nm14[rnd5] + nm15[rnd3];
|
|
}
|
|
testSwear(nMs);
|
|
}
|