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

lolTrollNames.js (1820B)


      1 var nm1 = ["", "", "d", "dr", "g", "gh", "gr", "hg", "hr", "hz", "m", "r", "rh", "t", "tr", "v", "vh", "z"]
      2 var nm2 = ["a", "a", "e", "o", "u", "u"]
      3 var nm3 = ["dg", "dgr", "dl", "dr", "gd", "gdr", "gl", "gr", "gz", "lk", "lkr", "kr", "kd", "nd", "ndl", "ndr", "rg", "rgl", "rk", "zg", "zl", "zr"]
      4 var nm4 = ["a", "a", "e", "e", "o", "u"]
      5 var nm5 = ["", "d", "k", "l", "n", "r", "t", "z"]
      6 
      7 function nameGen() {
      8     $('#placeholder').css('textTransform', 'capitalize');
      9     var br = "";
     10     var element = document.createElement("div");
     11     element.setAttribute("id", "result");
     12     for (i = 0; i < 10; i++) {
     13         nameMas();
     14         while (nMs === "") {
     15             nameMas();
     16         }
     17         br = document.createElement('br');
     18         element.appendChild(document.createTextNode(nMs));
     19         element.appendChild(br);
     20     }
     21     if (document.getElementById("result")) {
     22         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     23     }
     24     document.getElementById("placeholder").appendChild(element);
     25 }
     26 
     27 function nameMas() {
     28     nTp = Math.random() * 3 | 0;
     29     rnd = Math.random() * nm1.length | 0;
     30     rnd2 = Math.random() * nm2.length | 0;
     31     rnd5 = Math.random() * nm5.length | 0;
     32     if (nTp === 0) {
     33         while (nm1[rnd] === "") {
     34             rnd = Math.random() * nm1.length | 0;
     35         }
     36         while (nm5[rnd5] === "" || nm5[rnd5] === nm1[rnd]) {
     37             rnd5 = Math.random() * nm5.length | 0;
     38         }
     39         nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd5];
     40     } else {
     41         rnd3 = Math.random() * nm3.length | 0;
     42         rnd4 = Math.random() * nm4.length | 0;
     43         while (nm3[rnd3] === nm1[rnd]) {
     44             rnd3 = Math.random() * nm3.length | 0;
     45         }
     46         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     47     }
     48     testSwear(nMs);
     49 }