offline-fantasy-name-generators

Offline version of www.fantasynamegenerators.com
git clone https://git.neptards.moe/neptards/offline-fantasy-name-generators.git
Log | Files | Refs | README

swSelonianNames.js (5387B)


      1 var nm1 = ["ch", "d", "f", "g", "k", "kr", "m", "n", "p", "q", "r", "v", "z"];
      2 var nm2 = ["a", "e", "o", "u"];
      3 var nm3 = ["d", "dd", "dh", "h", "hl", "k", "kh", "kn", "l", "ld", "lm", "ln", "m", "n", "nd", "r", "y", "z", "zz"];
      4 var nm4 = ["d", "g", "k", "n", "r", "v", "yd", "z"];
      5 var nm5 = ["c", "ch", "d", "dr", "f", "g", "k", "kl", "l", "m", "n", "q", "s", "sh", "shr", "w"];
      6 var nm6 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ii", "ia", "ey", "ui", "oo"];
      7 var nm7 = ["ch", "cl", "cm", "cn", "g", "k", "l", "lc", "m", "n", "ntr", "r", "rc", "rk", "rsk", "rt", "s", "ss", "sth", "t", "th", "v", "y"];
      8 var nm8 = ["a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "y", "ei", "ea", "ae", "ee", "ii"];
      9 var nm9 = ["", "", "", "", "k", "l", "m", "n", "r", "s", "ts"];
     10 var nm10 = ["b", "d", "f", "k", "l", "p", "r", "s", "t", "th"];
     11 var nm11 = ["e", "i", "o", "u", "e", "i", "o", "u", "e", "i", "o", "u", "e", "i", "o", "u", "e", "i", "o", "u", "e", "i", "o", "u", "e", "i", "o", "u", "ie", "ia"];
     12 var nm12 = ["h", "h", "l", "l", "ln", "m", "m", "md", "nd", "ndr", "nt", "r", "r", "rr", "rt", "s", "s", "ss", "sd", "st", "tt", "v", "v", "w", "w"];
     13 var nm13 = ["e", "o", "u", "e", "o", "u", "e", "o", "u", "e", "o", "u", "ya", "oo"];
     14 var nm14 = ["", "", "", "", "", "d", "k", "l", "m", "n", "r", "rr", "s"];
     15 var br = "";
     16 
     17 function nameGen(type) {
     18     var tp = type;
     19     $('#placeholder').css('textTransform', 'capitalize');
     20     var element = document.createElement("div");
     21     element.setAttribute("id", "result");
     22     for (i = 0; i < 10; i++) {
     23         nameSur();
     24         while (nSr === "") {
     25             nameSur();
     26         }
     27         if (tp === 1) {
     28             nameFem();
     29             while (nMs === "") {
     30                 nameFem();
     31             }
     32         } else {
     33             nameMas();
     34             while (nMs === "") {
     35                 nameMas();
     36             }
     37         }
     38         names = nMs + " " + nSr;
     39         br = document.createElement('br');
     40         element.appendChild(document.createTextNode(names));
     41         element.appendChild(br);
     42     }
     43     if (document.getElementById("result")) {
     44         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     45     }
     46     document.getElementById("placeholder").appendChild(element);
     47 }
     48 
     49 function nameMas() {
     50     rnd = Math.random() * nm1.length | 0;
     51     rnd2 = Math.random() * nm2.length | 0;
     52     rnd3 = Math.random() * nm4.length | 0;
     53     while (nm4[rnd3] === nm1[rnd]) {
     54         rnd3 = Math.random() * nm4.length | 0;
     55     }
     56     if (i < 5) {
     57         nMs = nm1[rnd] + nm2[rnd2] + nm4[rnd3];
     58     } else {
     59         rnd4 = Math.random() * nm3.length | 0;
     60         rnd5 = Math.random() * nm2.length | 0;
     61         while (nm1[rnd] === nm3[rnd4] || nm3[rnd4] === nm4[rnd3]) {
     62             rnd4 = Math.random() * nm3.length | 0;
     63         }
     64         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm2[rnd5] + nm4[rnd3];
     65     }
     66     testSwear(nMs);
     67 }
     68 
     69 function nameFem() {
     70     rnd = Math.random() * nm5.length | 0;
     71     rnd2 = Math.random() * nm6.length | 0;
     72     rnd3 = Math.random() * nm9.length | 0;
     73     while (nm9[rnd3] === nm5[rnd]) {
     74         rnd3 = Math.random() * nm9.length | 0;
     75     }
     76     if (i < 3) {
     77         nMs = nm5[rnd] + nm6[rnd2] + nm9[rnd3];
     78     } else {
     79         rnd4 = Math.random() * nm7.length | 0;
     80         rnd5 = Math.random() * nm8.length | 0;
     81         while (nm5[rnd] === nm7[rnd4] || nm7[rnd4] === nm9[rnd3]) {
     82             rnd4 = Math.random() * nm7.length | 0;
     83         }
     84         if (i < 7) {
     85             nMs = nm5[rnd] + nm6[rnd2] + nm7[rnd4] + nm8[rnd5] + nm9[rnd3];
     86         } else {
     87             rnd6 = Math.random() * nm7.length | 0;
     88             rnd7 = Math.random() * nm8.length | 0;
     89             while (nm7[rnd6] === nm7[rnd4] || nm7[rnd6] === nm9[rnd3]) {
     90                 rnd6 = Math.random() * nm7.length | 0;
     91             }
     92             nMs = nm5[rnd] + nm6[rnd2] + nm7[rnd4] + nm8[rnd5] + nm7[rnd6] + nm8[rnd7] + nm9[rnd3];
     93         }
     94     }
     95     testSwear(nMs);
     96 }
     97 
     98 function nameSur() {
     99     sTp = Math.random() * 3 | 0;
    100     rnd = Math.random() * nm10.length | 0;
    101     rnd2 = Math.random() * nm11.length | 0;
    102     rnd3 = Math.random() * nm14.length | 0;
    103     while (nm14[rnd3] === nm10[rnd]) {
    104         rnd3 = Math.random() * nm14.length | 0;
    105     }
    106     if (sTp === 0) {
    107         nSr = nm10[rnd] + nm11[rnd2] + nm14[rnd3];
    108     } else {
    109         rnd4 = Math.random() * nm12.length | 0;
    110         rnd5 = Math.random() * nm13.length | 0;
    111         while (nm10[rnd] === nm12[rnd4] || nm12[rnd4] === nm14[rnd3]) {
    112             rnd4 = Math.random() * nm12.length | 0;
    113         }
    114         if (sTp === 1) {
    115             nSr = nm10[rnd] + nm11[rnd2] + nm12[rnd4] + nm13[rnd5] + nm14[rnd3];
    116         } else {
    117             rnd6 = Math.random() * nm12.length | 0;
    118             rnd7 = Math.random() * nm13.length | 0;
    119             while (nm12[rnd6] === nm12[rnd4] || nm12[rnd6] === nm14[rnd3]) {
    120                 rnd6 = Math.random() * nm12.length | 0;
    121             }
    122             nSr = nm10[rnd] + nm11[rnd2] + nm12[rnd4] + nm13[rnd5] + nm12[rnd6] + nm13[rnd7] + nm14[rnd3];
    123         }
    124     }
    125     testSwear(nSr);
    126 }