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

darkCrystalSkeksis.js (1860B)


      1 var nm1 = ["", "", "", "d", "g", "gr", "h", "l", "m", "n", "sh", "t", "th", "v", "vr", "y", "z", "zh"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ee", "ie"];
      3 var nm3 = ["h", "l", "n", "r", "y", "z"];
      4 var nm4 = ["a", "e", "i", "o", "u", "u"];
      5 var nm5 = ["", "", "", "", "", "", "ch", "d", "k", "kt", "l", "n", "ng", "nt", "r", "rt", "t", "th"];
      6 var br = "";
      7 
      8 function nameGen() {
      9     var element = document.createElement("div");
     10     element.setAttribute("id", "result");
     11     for (i = 0; i < 10; i++) {
     12         nameMas();
     13         while (nMs === "") {
     14             nameMas();
     15         }
     16         nMs = nMs.charAt(0).toUpperCase() + nMs.slice(1);
     17         names = "skek" + nMs;
     18         br = document.createElement('br');
     19         element.appendChild(document.createTextNode(names));
     20         element.appendChild(br);
     21     }
     22     if (document.getElementById("result")) {
     23         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     24     }
     25     document.getElementById("placeholder").appendChild(element);
     26 }
     27 
     28 function nameMas() {
     29     nTp = Math.random() * 4 | 0;
     30     rnd = Math.random() * nm1.length | 0;
     31     rnd2 = Math.random() * nm2.length | 0;
     32     rnd3 = Math.random() * nm5.length | 0;
     33     if (nTp < 3) {
     34         while (nm1[rnd] === "" && nm5[rnd3] === "") {
     35             rnd = Math.random() * nm1.length | 0;
     36             while (nm1[rnd] === nm5[rnd3]) {
     37                 rnd = Math.random() * nm1.length | 0;
     38             }
     39         }
     40         nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
     41     } else {
     42         rnd4 = Math.random() * nm3.length | 0;
     43         rnd5 = Math.random() * nm4.length | 0;
     44         while (nm3[rnd4] === nm5[rnd3] || rnd3[rnd4] === nm1[rnd]) {
     45             rnd4 = Math.random() * nm3.length | 0;
     46         }
     47         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm5[rnd3];
     48     }
     49     testSwear(nMs);
     50 }