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.
115 lines
4.3 KiB
JavaScript
115 lines
4.3 KiB
JavaScript
var nm1 = ["", "", "b", "c", "l", "n", "s", "t", "z", "ch", "dh", "dr", "gh", "sh", "st", "zh"];
|
|
var nm2 = ["a", "i", "o", "u"];
|
|
var nm3 = ["b", "f", "ff", "l", "lg", "m", "n", "ng", "r", "rl", "sh", "sl", "th", "z"];
|
|
var nm4 = ["a", "a", "i", "o", "u"];
|
|
var nm5 = ["dl", "dr", "g", "l", "lr", "kl", "rk", "s", "ss", "z", "zr"];
|
|
var nm6 = ["ie", "iay", "oo", "ey", "oa", "a", "i", "o", "a", "i", "o", "a", "i", "o", "a", "i", "o", "a", "i", "o", "a", "i", "o", "a", "i", "o", "a", "i", "o", "a", "i", "o"];
|
|
var nm7 = ["", "", "b", "k", "m", "p", "r", "sq", "ss", "t", "tt"];
|
|
var nm8 = ["ch", "f", "h", "m", "n", "r", "s", "sh", "th", "z", "zh"];
|
|
var nm9 = ["a", "i", "a", "i", "e", "u"];
|
|
var nm10 = ["ch", "ff", "h", "m", "n", "p", "r", "rm", "rth", "th"];
|
|
var nm11 = ["a", "a", "a", "e", "i"];
|
|
var nm12 = ["l", "ll", "n", "nn", "r", "rr", "s", "y", "z"];
|
|
var nm13 = ["a", "a", "e", "i", "i", "o", "o"];
|
|
var nm14 = ["", "", "", "", "", "", "", "h", "r", "s", "sh"];
|
|
var br = "";
|
|
|
|
function nameGen(type) {
|
|
$('#placeholder').css('textTransform', 'capitalize');
|
|
var tp = type;
|
|
var element = document.createElement("div");
|
|
element.setAttribute("id", "result");
|
|
for (i = 0; i < 10; i++) {
|
|
if (tp === 1) {
|
|
nameFem();
|
|
while (nMs === "") {
|
|
nameFem();
|
|
}
|
|
} else {
|
|
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 nameFem() {
|
|
nTp = Math.random() * 4 | 0;
|
|
rnd = Math.random() * nm8.length | 0;
|
|
rnd2 = Math.random() * nm9.length | 0;
|
|
rnd3 = Math.random() * nm10.length | 0;
|
|
rnd4 = Math.random() * nm13.length | 0;
|
|
rnd5 = Math.random() * nm14.length | 0;
|
|
if (nTp < 3) {
|
|
while (nm10[rnd3] === nm14[rnd5] || nm10[rnd3] === nm8[rnd]) {
|
|
rnd3 = Math.random() * nm10.length | 0;
|
|
}
|
|
nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd3] + nm13[rnd4] + nm14[rnd5];
|
|
} else {
|
|
rnd6 = Math.random() * nm11.length | 0;
|
|
rnd7 = Math.random() * nm12.length | 0;
|
|
while (nm14[rnd5] === nm12[rnd7] || nm12[rnd7] === nm10[rnd3]) {
|
|
rnd7 = Math.random() * nm12.length | 0;
|
|
}
|
|
nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd3] + nm11[rnd6] + nm12[rnd7] + nm13[rnd4] + nm14[rnd5];
|
|
}
|
|
testSwear(nMs);
|
|
}
|
|
|
|
function nameMas() {
|
|
nTp = Math.random() * 7 | 0;
|
|
rnd = Math.random() * nm1.length | 0;
|
|
rnd2 = Math.random() * nm6.length | 0;
|
|
rnd5 = Math.random() * nm7.length | 0;
|
|
if (nTp < 2) {
|
|
while (nm1[rnd] === "") {
|
|
rnd = Math.random() * nm1.length | 0;
|
|
}
|
|
while (nm7[rnd5] === "" || nm1[rnd] === nm7[rnd5]) {
|
|
rnd5 = Math.random() * nm7.length | 0;
|
|
}
|
|
if (rnd < 9) {
|
|
while (rnd5 < 7) {
|
|
rnd5 = Math.random() * nm7.length | 0;
|
|
}
|
|
}
|
|
nMs = nm1[rnd] + nm6[rnd2] + nm7[rnd5];
|
|
} else {
|
|
rnd8 = Math.random() * nm2.length | 0;
|
|
if (nTp < 6) {
|
|
rnd3 = Math.random() * nm3.length | 0;
|
|
while (nm3[rnd3] === nm7[rnd5] || nm3[rnd3] === nm1[rnd]) {
|
|
rnd3 = Math.random() * nm3.length | 0;
|
|
}
|
|
while (rnd2 < 4 && nm7[rnd5] === "p") {
|
|
rnd5 = Math.random() * nm7.length | 0;
|
|
}
|
|
nMs = nm1[rnd] + nm2[rnd8] + nm3[rnd3] + nm6[rnd2] + nm7[rnd5];
|
|
} else {
|
|
rnd6 = Math.random() * nm4.length | 0;
|
|
rnd7 = Math.random() * nm5.length | 0;
|
|
while (nm3[rnd5] === nm5[rnd7] || nm5[rnd7] === nm7[rnd5]) {
|
|
rnd7 = Math.random() * nm5.length | 0;
|
|
}
|
|
if (nm7[rnd5] === "sq") {
|
|
while (rnd2 < 4) {
|
|
rnd2 = Math.random() * nm6.length | 0;
|
|
}
|
|
}
|
|
while (rnd2 < 4) {
|
|
rnd2 = Math.random() * nm6.length | 0;
|
|
}
|
|
nMs = nm1[rnd] + nm2[rnd8] + nm3[rnd3] + nm4[rnd6] + nm5[rnd7] + nm6[rnd2] + nm7[rnd5];
|
|
}
|
|
}
|
|
testSwear(nMs);
|
|
}
|