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.

75 lines
3.6 KiB
JavaScript

var nm1 = ["", "b", "d", "f", "g", "h", "k", "m", "n", "s", "sh", "w", "z"];
var nm2 = ["a", "e", "o", "u"];
var nm3 = ["cr", "gl", "gr", "mb", "mp", "rbl", "rdl", "rgl", "rn", "sb", "sk", "str", "tr", "tl", "ttl", "zb", "zl", "zk", "ztr"];
var nm4 = ["a", "e", "e", "i", "i", "o", "o", "u"];
var nm5 = ["f", "ff", "g", "g", "mp", "k", "m", "n", "n", "nn", "nd", "nt", "r", "r", "rd", "rm", "rn", "rt", "st", "s", "ss", "t", "tt"];
var nm6 = ["", "g", "k", "m", "n", "r", "t"];
var nm7 = ["mouth", "nose", "head", "chest", "back", "mouthed", "nosed", "headed", "chested", "backed", "feet", "hands", "eyes", "ears", "arms", "legs", "handed", "legged", "armed", "eared", "limbs", "limbed", "fingers", "fingered", "toes", "toed"];
var nm8 = ["no", "zero", "double", "two", "twin", "extra", "split", "triple", "trice", "three", "quadrupel", "quad", "four", "five", "six", "seven", "eight", "dozen"];
var nm9 = ["bark", "root", "stone", "liquid", "little", "big", "twist", "split", "twin", "break", "broken", "gore", "warp", "demon", "angel", "fiend", "bone", "craven", "dire", "long", "shrunk", "balloon", "feeble", "giant", "grim", "high", "no", "limp", "light", "low", "high", "mad", "numb"];
var nm10 = ["mouth", "nose", "head", "chest", "back", "mouthed", "nosed", "headed", "chested", "backed", "feet", "hands", "eyes", "ears", "arms", "legs", "handed", "legged", "armed", "eared", "limbs", "limbed", "fingers", "fingered", "toes"];
var nm11 = [" ", "-", ""];
var br = "";
function nameGen() {
$('#placeholder').css('textTransform', 'capitalize');
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
nameMas();
while (nMs === "") {
nameMas();
}
nTp = Math.random() * 2 | 0;
rnd11 = Math.random() * nm11.length | 0;
if (nTp === 0) {
rnd = Math.random() * nm7.length | 0;
if (rnd < 10) {
rnd2 = Math.random() * 7 | 0;
} else if (rnd < 20) {
rnd2 = Math.random() * 13 | 0;
} else if (rnd < 22) {
rnd2 = Math.random() * 17 | 0;
} else {
rnd2 = Math.random() * nm8.length | 0;
}
nMs += ", " + nm8[rnd2] + nm11[rnd11] + nm7[rnd];
} else {
rnd = Math.random() * nm9.length | 0;
rnd2 = Math.random() * nm10.length | 0;
nMs += ", " + nm9[rnd] + nm11[rnd11] + nm10[rnd2];
}
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 nameMas() {
nTp = Math.random() * 6 | 0;
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
if (nTp < 2) {
rnd3 = Math.random() * nm5.length | 0;
while (nm1[rnd] === "" || nm1[rnd] === nm5[rnd3]) {
rnd = Math.random() * nm1.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
} else {
rnd3 = Math.random() * nm3.length | 0;
rnd4 = Math.random() * nm4.length | 0;
rnd5 = Math.random() * nm6.length | 0;
if (nm3[rnd3] > 8) {
while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm6[rnd5]) {
rnd3 = Math.random() * nm3.length | 0;
}
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm6[rnd5];
}
testSwear(nMs);
}