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.

90 lines
5.1 KiB
JavaScript

var nm1 = ["amber", "apple", "autumn", "beech", "bell", "birch", "bird", "boulder", "clear", "clover", "dawn", "dew", "dusk", "earth", "elder", "ember", "fall", "far", "feather", "fig", "fir", "free", "glimmer", "grand", "grass", "great", "green", "half", "hay", "hazel", "hen", "high", "hollow", "honey", "lake", "light", "lilly", "little", "low", "luck", "maple", "meadow", "mid", "mint", "mist", "moon", "moss", "nettle", "never", "night", "oak", "oaken", "old", "pea", "pine", "plum", "plume", "pond", "prune", "raven", "river", "root", "rose", "shadow", "shimmer", "silent", "silver", "sprig", "spring", "star", "stone", "storm", "straw", "summer", "sun", "tea", "thorn", "timber", "twig", "twine", "vine", "violet", "whit", "wild", "wilde", "willow", "wind", "winter", "wolf", "wood"];
var nm2 = ["barrow", "bell", "blossom", "borough", "bottom", "bourne", "breach", "break", "breeze", "brook", "burgh", "cairn", "call", "crest", "dale", "denn", "down", "drift", "end", "fall", "field", "front", "garde", "glen", "grasp", "grove", "guard", "hallow", "ham", "haven", "hold", "hollow", "horn", "light", "meadow", "mere", "more", "mount", "pass", "point", "post", "reach", "rest", "ridge", "rim", "run", "shade", "shadow", "shire", "spell", "star", "strand", "vale", "valley", "vein", "view", "wallow", "ward", "watch", "water", "well", "wood"];
var nm3 = ["", "", "", "b", "c", "d", "f", "g", "h", "kh", "l", "m", "n", "r", "s", "th", "v", "y", "z"];
var nm4 = ["a", "e", "i", "u", "a", "e", "i", "u", "a", "e", "i", "u", "a", "e", "i", "u", "o", "a", "e", "i", "u", "a", "e", "i", "u", "a", "e", "i", "u", "a", "e", "i", "u", "o", "ui", "ai"];
var nm5 = ["d", "dr", "l", "ld", "ll", "lm", "lv", "m", "mn", "n", "nl", "nm", "nr", "r", "rd", "rl", "rr", "rv", "s", "sl", "sr", "v", "vl"];
var nm6 = ["a", "e", "i", "u", "y", "a", "e", "i", "u", "y", "a", "e", "i", "u", "y", "o"];
var nm7 = ["d", "k", "l", "m", "n", "r", "th", "v"];
var nm8 = ["e", "i", "y", "e", "i", "y", "e", "i", "o", "y", "e", "i", "y", "e", "i", "y", "e", "i", "o", "y", "ui", "ai"];
var nm9 = ["", "", "d", "l", "l", "ld", "lm", "ln", "m", "n", "n", "r", "r", "rd", "rn"];
function nameGen() {
$('#placeholder').css('textTransform', 'capitalize');
var br = "";
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
if (i < 5) {
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
while (nm1[rnd] === nm2[rnd2]) {
rnd2 = Math.random() * nm2.length | 0;
}
names = nm1[rnd] + nm2[rnd2];
} else {
nameSur();
while (nMs === "") {
nameSur();
}
names = nMs;
}
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 nameSur() {
nTp = Math.random() * 6 | 0;
rnd = Math.random() * nm3.length | 0;
rnd2 = Math.random() * nm4.length | 0;
rnd3 = Math.random() * nm9.length | 0;
if (nTp < 4) {
rnd4 = Math.random() * nm5.length | 0;
rnd5 = Math.random() * nm8.length | 0;
while (nm5[rnd4] === nm3[rnd] || nm5[rnd4] === nm9[rnd3]) {
rnd4 = Math.random() * nm5.length | 0;
}
nMs = nm3[rnd] + nm4[rnd2] + nm5[rnd4] + nm8[rnd5] + nm9[rnd3];
if (nTp < 2) {
rnd = Math.random() * nm3.length | 0;
rnd2 = Math.random() * nm4.length | 0;
rnd3 = Math.random() * nm9.length | 0;
if (nTp === 0) {
while (nm9[rnd3] === "" && nm3[rnd] === "") {
rnd = Math.random() * nm3.length | 0;
}
nMs = nm3[rnd] + nm4[rnd2] + nm9[rnd3] + " " + nMs;
} else {
rnd4 = Math.random() * nm5.length | 0;
rnd5 = Math.random() * nm8.length | 0;
while (nm5[rnd4] === nm3[rnd] || nm5[rnd4] === nm9[rnd3]) {
rnd4 = Math.random() * nm5.length | 0;
}
nMs = nMs + " " + nm4[rnd2] + nm5[rnd4] + nm8[rnd5] + nm9[rnd3];
}
}
} else {
rnd4 = Math.random() * nm5.length | 0;
rnd5 = Math.random() * nm6.length | 0;
rnd6 = Math.random() * nm7.length | 0;
rnd7 = Math.random() * nm8.length | 0;
while (nm5[rnd4] === nm3[rnd] || nm5[rnd4] === nm7[rnd6]) {
rnd4 = Math.random() * nm5.length | 0;
}
while (nm9[rnd3] === nm7[rnd6] || nm5[rnd4] === nm7[rnd6]) {
rnd6 = Math.random() * nm7.length | 0;
}
if (nTp === 4) {
nMs = nm3[rnd] + nm4[rnd2] + nm5[rnd4] + nm6[rnd5] + nm7[rnd6] + nm8[rnd7] + nm9[rnd3];
} else {
nMs = nm3[rnd] + nm4[rnd2] + nm7[rnd6] + nm6[rnd5] + nm5[rnd4] + nm8[rnd7] + nm9[rnd3];
}
}
testSwear(nMs);
}