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

districtNames.js (4340B)


      1 var nm1 = ["b", "c", "d", "f", "g", "h", "l", "m", "n", "p", "r", "s", "t", "w", "y", "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z", "bl", "br", "ch", "cl", "cr", "dr", "fl", "fr", "gl", "gr", "pl", "pr", "sc", "sh", "sk", "sl", "sm", "sn", "sp", "st", "sw", "tr", "tw", "wh", "wr", "sch", "scr", "sph", "shr", "spl", "spr", "str", "thr"];
      2 var nm2 = ["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", "ai", "eo", "ea", "ee", "oo", "oa", "ia", "io"];
      3 var nm3 = ["br", "bl", "c", "ch", "cl", "ct", "ck", "cc", "d", "dg", "dw", "dr", "dl", "f", "g", "gg", "gl", "gw", "gr", "h", "k", "kr", "kw", "l", "ll", "lb", "ld", "lg", "lm", "ln", "lr", "lw", "lz", "m", "mr", "ml", "nw", "n", "nn", "ng", "nl", "p", "ph", "r", "rb", "rc", "rd", "rg", "rl", "rm", "rn", "rr", "rs", "rst", "rt", "rth", "rtr", "rw", "rv", "s", "ss", "sh", "st", "sth", "str", "sl", "sw", "t", "tb", "tl", "tg", "tm", "tn", "tw", "th", "tt", "v", "w", "wl", "wn", "x", "z"];
      4 var nm4 = ["c", "d", "f", "ff", "g", "gg", "h", "l", "ll", "m", "mm", "n", "nn", "p", "pp", "r", "rr", "s", "ss", "t", "tt", "w"];
      5 var nm5 = ["st", "sk", "sp", "nd", "nt", "nk", "mp", "rd", "ld", "lp", "rk", "lt", "lf", "pt", "ft", "ct", "t", "d", "k", "n", "p", "l", "g", "m", "s", "b", "c", "t", "d", "k", "n", "p", "l", "g", "m", "s", "b", "c"];
      6 var nm6 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "West", "East", "North", "South", "Little", "Upper", "Lower", "Fort", "Upper West", "Upper East", "Upper North", "Upper South", "Lower West", "Lower East", "Lower North", "Lower South", "Midtown", "Waterside", "Bayside", "Downtown"];
      7 var nm7 = ["", "Acre", "Avenue", "Bazaar", "Boulevard", "Center", "Circle", "Corner", "Cross", "District", "East", "Garden", "Grove", "Heights", "Hill", "Hills", "Market", "North", "Park", "Place", "Plaza", "Point", "Road", "Row", "Side", "South", "Square", "Street", "Town", "Vale", "Valley", "West", "Wood", "Yard"];
      8 var br = "";
      9 
     10 function nameGen() {
     11     $('#placeholder').css('textTransform', 'capitalize');
     12     var element = document.createElement("div");
     13     element.setAttribute("id", "result");
     14     for (i = 0; i < 10; i++) {
     15         rnd6 = Math.floor(Math.random() * nm6.length);
     16         rnd7 = Math.floor(Math.random() * nm7.length);
     17         if (rnd6 < 20) {
     18             while (rnd7 === 0) {
     19                 rnd7 = Math.floor(Math.random() * nm7.length);
     20             }
     21         } else {
     22             rnd7 = 0;
     23         }
     24         rnd = Math.floor(Math.random() * nm1.length);
     25         rnd2 = Math.floor(Math.random() * nm2.length);
     26         rnd5 = Math.floor(Math.random() * nm5.length);
     27         if (i < 2) {
     28             names = nm6[rnd6] + " " + nm1[rnd] + nm2[rnd2] + nm5[rnd5] + "  " + nm7[rnd7];
     29         } else if (i < 4) {
     30             rnd3 = Math.floor(Math.random() * nm3.length);
     31             rnd4 = Math.floor(Math.random() * nm2.length);
     32             names = nm6[rnd6] + " " + nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm5[rnd5] + "  " + nm7[rnd7];
     33         } else if (i < 8) {
     34             rnd3 = Math.floor(Math.random() * nm4.length);
     35             rnd4 = Math.floor(Math.random() * nm2.length);
     36             names = nm6[rnd6] + " " + nm1[rnd] + nm2[rnd2] + nm4[rnd3] + nm2[rnd4] + nm5[rnd5] + "  " + nm7[rnd7];
     37         } else {
     38             rnd3 = Math.floor(Math.random() * nm3.length);
     39             rnd4 = Math.floor(Math.random() * nm2.length);
     40             rnd6 = Math.floor(Math.random() * nm4.length);
     41             rnd7 = Math.floor(Math.random() * nm2.length);
     42             if (i < 8) {
     43                 names = nm6[rnd6] + " " + nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd6] + nm2[rnd7] + nm5[rnd5] + "  " + nm7[rnd7];
     44             } else {
     45                 names = nm6[rnd6] + " " + nm1[rnd] + nm2[rnd2] + nm4[rnd6] + nm2[rnd4] + nm3[rnd3] + nm2[rnd7] + nm5[rnd5] + "  " + nm7[rnd7];
     46             }
     47         }
     48         br = document.createElement('br');
     49         element.appendChild(document.createTextNode(names));
     50         element.appendChild(br);
     51     }
     52     if (document.getElementById("result")) {
     53         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     54     }
     55     document.getElementById("placeholder").appendChild(element);
     56 }