planetNames.js (4261B)
1 var nm1 = ["b", "c", "ch", "d", "g", "h", "k", "l", "m", "n", "p", "r", "s", "t", "th", "v", "x", "y", "z", "", "", "", "", ""]; 2 var nm2 = ["a", "e", "i", "o", "u"]; 3 var nm3 = ["b", "bb", "br", "c", "cc", "ch", "cr", "d", "dr", "g", "gn", "gr", "l", "ll", "lr", "lm", "ln", "lv", "m", "n", "nd", "ng", "nk", "nn", "nr", "nv", "nz", "ph", "s", "str", "th", "tr", "v", "z"]; 4 var nm3b = ["b", "br", "c", "ch", "cr", "d", "dr", "g", "gn", "gr", "l", "ll", "m", "n", "ph", "s", "str", "th", "tr", "v", "z"]; 5 var nm4 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ae", "ai", "ao", "au", "a", "ea", "ei", "eo", "eu", "e", "ua", "ue", "ui", "u", "ia", "ie", "iu", "io", "oa", "ou", "oi", "o"]; 6 var nm5 = ["turn", "ter", "nus", "rus", "tania", "hiri", "hines", "gawa", "nides", "carro", "rilia", "stea", "lia", "lea", "ria", "nov", "phus", "mia", "nerth", "wei", "ruta", "tov", "zuno", "vis", "lara", "nia", "liv", "tera", "gantu", "yama", "tune", "ter", "nus", "cury", "bos", "pra", "thea", "nope", "tis", "clite"]; 7 var nm6 = ["una", "ion", "iea", "iri", "illes", "ides", "agua", "olla", "inda", "eshan", "oria", "ilia", "erth", "arth", "orth", "oth", "illon", "ichi", "ov", "arvis", "ara", "ars", "yke", "yria", "onoe", "ippe", "osie", "one", "ore", "ade", "adus", "urn", "ypso", "ora", "iuq", "orix", "apus", "ion", "eon", "eron", "ao", "omia"]; 8 var nm7 = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; 9 var br = ""; 10 11 function nameGen() { 12 $('#placeholder').css('textTransform', 'capitalize'); 13 var element = document.createElement("div"); 14 element.setAttribute("id", "result"); 15 for (i = 0; i < 10; i++) { 16 if (i < 2) { 17 rnd = Math.random() * nm1.length | 0; 18 rnd2 = Math.random() * nm2.length | 0; 19 rnd3 = Math.random() * nm3.length | 0; 20 while (nm1[rnd] === nm3[rnd3]) { 21 rnd3 = Math.random() * nm3.length | 0; 22 } 23 rnd4 = Math.random() * nm4.length | 0; 24 rnd5 = Math.random() * nm5.length | 0; 25 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5]; 26 } else if (i < 4) { 27 rnd = Math.random() * nm1.length | 0; 28 rnd2 = Math.random() * nm2.length | 0; 29 rnd3 = Math.random() * nm3.length | 0; 30 while (nm1[rnd] === nm3[rnd3]) { 31 rnd3 = Math.random() * nm3.length | 0; 32 } 33 rnd4 = Math.random() * nm6.length | 0; 34 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd4]; 35 } else if (i < 6) { 36 rnd = Math.random() * nm1.length | 0; 37 rnd4 = Math.random() * nm4.length | 0; 38 rnd5 = Math.random() * nm5.length | 0; 39 names = nm1[rnd] + nm4[rnd4] + nm5[rnd5]; 40 } else if (i < 8) { 41 rnd = Math.random() * nm1.length | 0; 42 rnd2 = Math.random() * nm2.length | 0; 43 rnd3 = Math.random() * nm3b.length | 0; 44 while (nm1[rnd] === nm3b[rnd3]) { 45 rnd3 = Math.random() * nm3b.length | 0; 46 } 47 rnd4 = Math.random() * nm2.length | 0; 48 rnd5 = Math.random() * nm5.length | 0; 49 names = nm3b[rnd3] + nm2[rnd2] + nm1[rnd] + nm2[rnd4] + nm5[rnd5]; 50 } else { 51 rnd = Math.random() * nm3b.length | 0; 52 rnd2 = Math.random() * nm6.length | 0; 53 rnd3 = Math.random() * nm7.length | 0; 54 rnd4 = Math.random() * nm7.length | 0; 55 rnd5 = Math.random() * nm7.length | 0; 56 rnd6 = Math.random() * nm7.length | 0; 57 names = nm3b[rnd] + nm6[rnd2] + " " + nm7[rnd3] + nm7[rnd4] + nm7[rnd5] + nm7[rnd6]; 58 } 59 br = document.createElement('br'); 60 element.appendChild(document.createTextNode(names)); 61 element.appendChild(br); 62 } 63 if (document.getElementById("result")) { 64 document.getElementById("placeholder").removeChild(document.getElementById("result")); 65 } 66 document.getElementById("placeholder").appendChild(element); 67 }