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

rsTokhaar.js (1719B)


      1 var nm1 = ["", "", "b", "d", "h", "j", "k", "m", "n", "r", "t", "x", "v", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "y"];
      3 var nm3 = ["c", "d", "dd", "j", "k", "l", "ll", "n", "q", "r", "t", "tt"];
      4 var br = "";
      5 
      6 function nameGen() {
      7     var element = document.createElement("div");
      8     element.setAttribute("id", "result");
      9     for (i = 0; i < 10; i++) {
     10         nTp = Math.random() * 6 | 0;
     11         nameMas();
     12         while (nMs === "") {
     13             nameMas();
     14         }
     15         nMs = nMs.charAt(0).toUpperCase() + nMs.slice(1);
     16         if (i < 5) {
     17             names = "TokHaar-" + nMs;
     18         } else {
     19             names = "TzHaar-" + nMs;
     20         }
     21         if (nTp < 3) {
     22             nameMas();
     23             while (nMs === "") {
     24                 nameMas();
     25             }
     26             nMs = nMs.charAt(0).toUpperCase() + nMs.slice(1);
     27             names = names + "-" + nMs;
     28         }
     29         if (nTp === 0) {
     30             nameMas();
     31             while (nMs === "" || rnd < 2) {
     32                 nameMas();
     33             }
     34             nMs = nMs.charAt(0).toUpperCase() + nMs.slice(1);
     35             names = names + nMs;
     36         }
     37         br = document.createElement('br');
     38         element.appendChild(document.createTextNode(names));
     39         element.appendChild(br);
     40     }
     41     if (document.getElementById("result")) {
     42         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     43     }
     44     document.getElementById("placeholder").appendChild(element);
     45 }
     46 
     47 function nameMas() {
     48     rnd = Math.random() * nm1.length | 0;
     49     rnd2 = Math.random() * nm2.length | 0;
     50     rnd3 = Math.random() * nm3.length | 0;
     51     nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3];
     52     testSwear(nMs);
     53 }