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

greekLetterOrgs.js (1281B)


      1 var nm1 = ["Alpha", "Beta", "Chi", "Delta", "Epsilon", "Eta", "Gamma", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Omega", "Omicron", "Phi", "Pi", "Psi", "Rho", "Sigma", "Tau", "Theta", "Upsilon", "Xi", "Zeta"];
      2 
      3 function nameGen() {
      4     var br = "";
      5     var element = document.createElement("div");
      6     element.setAttribute("id", "result");
      7     for (i = 0; i < 10; i++) {
      8         nTp = Math.random() * 4 | 0;
      9         rnd = Math.random() * nm1.length | 0;
     10         rnd2 = Math.random() * nm1.length | 0;
     11         if (nTp === 0) {
     12             names = nm1[rnd] + " " + nm1[rnd2];
     13         } else {
     14             rnd3 = Math.random() * nm1.length | 0;
     15             if (nTp < 3) {
     16                 names = nm1[rnd] + " " + nm1[rnd2] + " " + nm1[rnd3];
     17             } else {
     18                 rnd4 = Math.random() * nm1.length | 0;
     19                 names = nm1[rnd] + " " + nm1[rnd2] + " " + nm1[rnd3] + " " + nm1[rnd4];
     20             }
     21         }
     22         br = document.createElement('br');
     23         element.appendChild(document.createTextNode(names));
     24         element.appendChild(br);
     25     }
     26     if (document.getElementById("result")) {
     27         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     28     }
     29     document.getElementById("placeholder").appendChild(element);
     30 }