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.

131 lines
7.2 KiB
JavaScript

var nm1 = ["b", "br", "c", "gr", "l", "m", "n", "r", "sh", "t", "z", "", ""];
var nm2 = ["eo", "ia", "ea", "y", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u"];
var nm3 = ["r", "rd", "rn", "rr", "s", "t", "v"];
var nm4 = ["a", "e", "i"];
var nm5 = ["f", "l", "r", "s", "v"];
var nm6 = ["oo", "ie", "a", "e", "e", "i", "o", "o", "a", "e", "e", "i", "o", "o", "a", "e", "e", "i", "o", "o"];
var nm7 = ["mm", "k", "l", "n", "r", "", "", ""];
var nm8 = ["", "", "", "br", "h", "j", "m", "n", "s", "t", "w", "", ""];
var nm9 = ["y", "a", "e", "i", "o", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "a", "e", "i", "o", "u"];
var nm10 = ["j", "l", "ll", "m", "n", "r", "rr", "s", "tt"];
var nm11 = ["a", "e", "i", "o", "u"];
var nm12 = ["l", "m", "n", "s", "r", "t"];
var nm13 = ["a", "e", "i"];
var nm14 = ["br", "ld", "ll", "n", "nt", "r", "t", "tt"];
var nm15 = ["ia", "ea", "a", "e", "i", "o"];
var nm16 = ["h", "n", "", "", "", "", "", "", "", "", ""];
var nm17 = ["Amphipod", "Ant", "Aphid", "Arachnid", "Bee", "Beetle", "Billbug", "Borer", "Bug", "Bumblebee", "Butterfly", "Caterpillar", "Centipede", "Chigger", "Cicada", "Cockroach", "Crawler", "Cricket", "Damselfly", "Dragonfly", "Earwig", "Flatworm", "Flea", "Fly", "Grasshopper", "Grub", "Hopper", "Horntail", "Katydid", "Lacewing", "Ladybird", "Larva", "Leech", "Locust", "Longhorn", "Louse", "Maggot", "Mantid", "Mantis", "Mayfly", "Millipede", "Mite", "Mosquito", "Moth", "Nepidae", "Parasite", "Peripatus", "Psocid", "Pupa", "Scarab", "Silverfish", "Slater", "Slug", "Snail", "Sowbug", "Spider", "Spittlebug", "Springtail", "Stick", "Stonefly", "Termite", "Thrip", "Tick", "Wasp", "Weevil", "Weta", "Worm", "Ash", "Ashes", "Bandit", "Blitz", "Boots", "Buddy", "Buttons", "Chuck", "Chuckles", "Cinder", "Cookie", "Echo", "Fangs", "Fuzz", "Gadget", "Gambit", "Ghost", "Jiggles", "Jitters", "Junior", "Lance", "Marble", "Midnight", "Mittens", "Muffin", "Nemesis", "Nightmare", "Noodle", "Nugget", "Patches", "Rebel", "Rider", "Scooter", "Scratch", "Scruff", "Shadow", "Spike", "Spinner", "Stitches", "Tinker", "Truffle", "Venom", "Whiskers", "Whisper"];
var nm18 = ["Amphipod", "Ant", "Aphid", "Arachnid", "Bee", "Beetle", "Billbug", "Borer", "Bug", "Bumblebee", "Butterfly", "Caterpillar", "Centipede", "Chigger", "Cicada", "Cockroach", "Crawler", "Cricket", "Damselfly", "Dragonfly", "Earwig", "Flatworm", "Flea", "Fly", "Grasshopper", "Grub", "Hopper", "Horntail", "Katydid", "Lacewing", "Ladybird", "Larva", "Leech", "Locust", "Longhorn", "Louse", "Maggot", "Mantid", "Mantis", "Mayfly", "Millipede", "Mite", "Mosquito", "Moth", "Nepidae", "Parasite", "Peripatus", "Psocid", "Pupa", "Scarab", "Silverfish", "Slater", "Slug", "Snail", "Sowbug", "Spider", "Spittlebug", "Springtail", "Stick", "Stonefly", "Termite", "Thrip", "Tick", "Wasp", "Weevil", "Weta", "Worm", "Amber", "Arachne", "Arack", "Aragi", "Arania", "Ash", "Aura", "Aurora", "Bitsy", "Blossom", "Breeze", "Bumble", "Buttercup", "Button", "Buttons", "Charm", "Cheeky", "Cinders", "Coco", "Cookie", "Cotton", "Crystal", "Cuddles", "Daisy", "Dawn", "Dot", "Echo", "Ember", "Enigma", "Fancy", "Fangs", "Fuzzles", "Gadget", "Giggles", "Happy", "Iris", "Ivory", "Jewel", "Jinx", "Legs", "Lucky", "Mittens", "Mothrine", "Pebble", "Pebbles", "Phobia", "Poison", "Princess", "Scarlet", "Socks", "Spindle", "Sugar", "Sunshine", "Twilight", "Twitch", "Velvet", "Venom", "Violet"];
function nameGen(type) {
$('#placeholder').css('textTransform', 'capitalize');
var tp = type;
var br = "";
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
rNd = Math.random() * 2 | 0;
if (rNd === 0) {
if (tp === 1) {
nameFem();
while (nMs === "") {
nameFem();
}
} else {
nameMas();
while (nMs === "") {
nameMas();
}
}
} else {
if (tp === 1) {
rnd = Math.random() * nm18.length | 0;
nMs = nm18[rnd];
} else {
rnd = Math.random() * nm17.length | 0;
nMs = nm17[rnd];
}
}
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() * 8 | 0;
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
rnd3 = Math.random() * nm7.length | 0;
if (nTp < 2) {
while (nm1[rnd] === "") {
rnd = Math.random() * nm1.length | 0;
}
if (nm7[rnd3] === "" && rnd2 > 2) {
rnd2 = Math.random() * 3 | 0;
} else {
while (nm7[rnd3] === "") {
rnd3 = Math.random() * nm7.length | 0;
}
}
nMs = nm1[rnd] + nm2[rnd2] + nm7[rnd3];
} else if (nTp < 7) {
rnd4 = Math.random() * nm3.length | 0;
rnd7 = Math.random() * nm6.length | 0;
while (nm7[rnd3] === "mm") {
rnd3 = Math.random() * nm7.length | 0;
}
while (nm3[rnd4] === nm1[rnd] && nm3[rnd4] === nm7[rnd3]) {
rnd4 = Math.random() * nm3.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm6[rnd7] + nm7[rnd3];
} else {
while (nm7[rnd3] === "mm") {
rnd3 = Math.random() * nm7.length | 0;
}
rnd5 = Math.random() * nm4.length | 0;
rnd6 = Math.random() * nm5.length | 0;
while (nm3[rnd4] === nm5[rnd6] && nm5[rnd6] === nm7[rnd3]) {
rnd6 = Math.random() * nm5.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm5[rnd6] + nm6[rnd7] + nm7[rnd3];
}
testSwear(nMs);
}
function nameFem() {
nTp = Math.random() * 7 | 0;
rnd = Math.random() * nm8.length | 0;
rnd2 = Math.random() * nm9.length | 0;
rnd4 = Math.random() * nm10.length | 0;
rnd5 = Math.random() * nm15.length | 0;
rnd3 = Math.random() * nm16.length | 0;
while (nm8[rnd] === nm10[rnd4] || nm10[rnd4] === nm16[rnd3]) {
rnd4 = Math.random() * nm10.length | 0;
}
if (nTp < 4) {
nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd4] + nm15[rnd5] + nm16[rnd3];
} else {
rnd6 = Math.random() * nm11.length | 0;
rnd7 = Math.random() * nm12.length | 0;
while (nm10[rnd4] === nm12[rnd7] || nm12[rnd7] === nm16[rnd3]) {
rnd7 = Math.random() * nm12.length | 0;
}
if (nTp < 6) {
nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd4] + nm11[rnd6] + nm12[rnd7] + nm15[rnd5] + nm16[rnd3];
} else {
rnd8 = Math.random() * nm13.length | 0;
rnd9 = Math.random() * nm14.length | 0;
while (nm12[rnd7] === nm13[rnd8] || nm13[rnd8] === nm16[rnd3]) {
rnd8 = Math.random() * nm13.length | 0;
}
nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd4] + nm11[rnd6] + nm12[rnd7] + nm13[rnd8] + nm14[rnd9] + nm15[rnd5] + nm16[rnd3];
}
}
testSwear(nMs);
}