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.

122 lines
4.9 KiB
JavaScript

var nm1 = ["dh", "dr", "g", "gh", "gr", "k", "kh", "kr", "l", "m", "n", "q", "qh", "qr", "r", "rh", "sh", "z", "zh"];
var nm2 = ["e", "o", "y", "e", "o", "i", "a", "u"];
var nm3 = ["dw", "g", "gh", "gr", "gw", "ld", "lw", "m", "mn", "mw", "n", "nd", "nh", "ng", "nw", "nr", "nz", "rg", "rw", "rz", "sg", "sr", "sz", "w", "wr", "z", "zn", "zr"];
var nm4 = ["a", "o", "u", "a", "o", "u", "i", "e"];
var nm5 = ["d", "h", "ld", "ldt", "ln", "m", "n", "nd", "r", "rd", "rn"];
var nm6 = ["f", "h", "l", "n", "ph", "r", "s", "t", "v", "y", "z"];
var nm7 = ["a", "i", "a", "i", "e", "o", "u"];
var nm8 = ["d", "dh", "dw", "f", "fr", "h", "l", "lw", "ln", "lm", "m", "mn", "np", "nr", "nz", "phr", "r", "ry", "rp", "rw", "z", "zh", "zhr"];
var nm9 = ["a", "a", "i", "e", "u", "o", "a", "a", "e", "i", "o"];
var nm10 = ["h", "j", "l", "n", "r", "sh", "st", "th", "y", "v", "w", "z"];
var nm11 = ["a", "e", "o", "a", "e", "o", "i"];
var nm12 = ["d", "h", "l", "m", "n", "r", "sh", "t", "w", "y", "z"];
var nm13 = ["a", "o", "a", "o", "i", "e"];
var nm14 = ["b", "c", "d", "g", "h", "m", "n", "r", "v", "z"];
var nm15 = ["a", "e", "u", "a", "e", "u", "i", "o"];
var nm16 = ["b", "br", "d", "dr", "g", "gr", "gl", "j", "lc", "ld", "lg", "ns", "p", "r", "rt", "rv", "rw", "z", "zr"];
var nm17 = ["a", "a", "e", "i", "o", "u"];
var nm18 = ["d", "g", "j", "l", "m", "n", "r", "v", "z"];
var nm19 = ["ee", "a", "o", "a", "o", "i", "e", "u", "a", "o", "a", "o", "i", "e", "u", "a", "o", "a", "o", "i", "e", "u"];
var nm20 = ["", "", "", "", "d", "m", "n", "nd", "r", "rn", "rd", "s", "sh", "t", "th", "y"];
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();
}
names = nSr;
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() {
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
rnd3 = Math.random() * nm5.length | 0;
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() * nm8.length | 0;
rnd4 = Math.random() * nm9.length | 0;
while (nm8[rnd3] === nm6[rnd]) {
rnd3 = Math.random() * nm8.length | 0;
}
if (nTp < 2) {
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4];
} else {
rnd5 = Math.random() * nm10.length | 0;
rnd6 = Math.random() * nm11.length | 0;
while (nm8[rnd3] === nm10[rnd5]) {
rnd5 = Math.random() * nm10.length | 0;
}
if (nTp < 4) {
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4] + nm10[rnd5] + nm11[rnd6];
} else {
rnd7 = Math.random() * nm12.length | 0;
rnd8 = Math.random() * nm13.length | 0;
while (nm12[rnd7] === nm10[rnd5]) {
rnd7 = Math.random() * nm12.length | 0;
}
nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4] + nm10[rnd5] + nm11[rnd6] + nm12[rnd7] + nm13[rnd8];
}
}
testSwear(nMs);
}
function nameSur() {
nTp = Math.random() * 6 | 0;
rnd = Math.random() * nm14.length | 0;
rnd2 = Math.random() * nm15.length | 0;
rnd3 = Math.random() * nm16.length | 0;
rnd4 = Math.random() * nm19.length | 0;
rnd5 = Math.random() * nm20.length | 0;
while (nm16[rnd3] === nm14[rnd] || nm16[rnd3] === nm20[rnd5]) {
rnd3 = Math.random() * nm16.length | 0;
}
if (nTp < 2) {
nSr = nm14[rnd] + nm15[rnd2] + nm16[rnd3] + nm19[rnd4] + nm20[rnd5];
} else {
rnd6 = Math.random() * nm17.length | 0;
rnd7 = Math.random() * nm18.length | 0;
while (nm16[rnd3] === nm18[rnd7] || nm18[rnd7] === nm20[rnd5]) {
rnd7 = Math.random() * nm18.length | 0;
}
nSr = nm14[rnd] + nm15[rnd2] + nm16[rnd3] + nm17[rnd6] + nm18[rnd7] + nm19[rnd4] + nm20[rnd5];
}
testSwear(nSr);
}