elezenNames.js (6475B)
1 var nm1 = ["A", "E", "I", "O", "U", "Au", "Eau", "A", "E", "I", "O"]; 2 var nm2 = ["b", "d", "f", "j", "l", "m", "n", "p", "r", "s", "t", "v", "z", "br", "dr", "fr", "gr", "str", "tr", "vr", "rr", "fl", "gl", "ll", "pl", "rl", "ch", "ph", "sh", "lb", "ld", "lf", "lm", "ln", "lp", "ls", "lv", "lw"]; 3 var nm3 = ["B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "V", "Z", "Br", "Dr", "Gr", "Pr", "Tr", "Cl", "Gl", "Sh", "Ph"]; 4 var nm4 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "eau", "oi", "au", "io", "ai", "eo", "ou", "ei", "io", "ia"]; 5 var nm5 = ["b", "c", "d", "f", "h", "l", "m", "n", "p", "r", "s", "t", "v", "w", "x", "y", "z", "ff", "ll", "mm", "nn", "rr", "ss", "tt", "sh", "ph", "ch"]; 6 var nm6 = ["onne", "inne", "anne", "ionne", "ianne", "one", "ine", "ane", "ione", "iane", "ette", "elle", "itte", "ie", "iene", "enne", "ene", "eanne", "eane", "eone", "eonne"]; 7 var nm7 = ["ant", "ault", "aut", "aux", "ax", "eaux", "ent", "ert", "eux", "ex", "ix", "oix", "ont", "ort", "oux"]; 8 var nm8 = ["a", "e", "i", "o", "u", "ui", "eau", "ai", "ou", "au", "ui", "ea", "ie"]; 9 var nm9 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "b", "c", "d", "f", "g", "h", "j", "l", "m", "n", "p", "r", "s", "t", "v"]; 10 var nm10 = ["", "a", "e", "i", "o", "u"]; 11 var nm11 = ["b", "c", "d", "f", "g", "h", "j", "l", "m", "n", "p", "r", "s", "t", "v"]; 12 var nm12 = ["ain", "air", "aire", "ame", "anc", "and", "ane", "ant", "ard", "at", "ault", "aut", "aux", "eaux", "elle", "ent", "eois", "ert", "ette", "eur", "eux", "ie", "ier", "iere", "ieu", "in", "ine", "ins", "ione", "ionne", "ois", "oix", "on", "ond", "ont", "ort", "oud", "oux", "oy", "uet", "uste"]; 13 14 function nameGen(type) { 15 var tp = type; 16 var br = ""; 17 var element = document.createElement("div"); 18 element.setAttribute("id", "result"); 19 for (i = 0; i < 10; i++) { 20 if (type === 1) { 21 if (i < 5) { 22 rnd = Math.floor(Math.random() * nm1.length); 23 rnd2 = Math.floor(Math.random() * nm2.length); 24 rnd5 = Math.floor(Math.random() * nm6.length); 25 rnd6 = Math.floor(Math.random() * nm3.length); 26 rnd7 = Math.floor(Math.random() * nm8.length); 27 rnd8 = Math.floor(Math.random() * nm9.length); 28 rnd9 = Math.floor(Math.random() * nm10.length); 29 if (rnd8 < 16) { 30 rnd9 = 0; 31 } 32 if (rnd8 > 15) { 33 while (rnd9 === 0) { 34 rnd9 = Math.floor(Math.random() * nm10.length); 35 } 36 } 37 rnd10 = Math.floor(Math.random() * nm11.length); 38 rnd11 = Math.floor(Math.random() * nm12.length); 39 names = nm1[rnd] + nm2[rnd2] + nm6[rnd5] + " " + nm3[rnd6] + nm8[rnd7] + nm9[rnd8] + nm10[rnd9] + nm11[rnd10] + nm12[rnd11]; 40 } else { 41 rnd = Math.floor(Math.random() * nm3.length); 42 rnd2 = Math.floor(Math.random() * nm4.length); 43 rnd3 = Math.floor(Math.random() * nm5.length); 44 rnd4 = Math.floor(Math.random() * nm6.length); 45 rnd6 = Math.floor(Math.random() * nm3.length); 46 rnd7 = Math.floor(Math.random() * nm8.length); 47 rnd8 = Math.floor(Math.random() * nm9.length); 48 rnd9 = Math.floor(Math.random() * nm10.length); 49 if (rnd8 < 16) { 50 rnd9 = 0; 51 } 52 if (rnd8 > 15) { 53 while (rnd9 === 0) { 54 rnd9 = Math.floor(Math.random() * nm10.length); 55 } 56 } 57 rnd10 = Math.floor(Math.random() * nm11.length); 58 rnd11 = Math.floor(Math.random() * nm12.length); 59 names = nm3[rnd] + nm4[rnd2] + nm5[rnd3] + nm6[rnd4] + " " + nm3[rnd6] + nm8[rnd7] + nm9[rnd8] + nm10[rnd9] + nm11[rnd10] + nm12[rnd11]; 60 } 61 } else { 62 if (i < 5) { 63 rnd = Math.floor(Math.random() * nm1.length); 64 rnd2 = Math.floor(Math.random() * nm2.length); 65 rnd5 = Math.floor(Math.random() * nm7.length); 66 rnd6 = Math.floor(Math.random() * nm3.length); 67 rnd7 = Math.floor(Math.random() * nm8.length); 68 rnd8 = Math.floor(Math.random() * nm9.length); 69 rnd9 = Math.floor(Math.random() * nm10.length); 70 if (rnd8 < 16) { 71 rnd9 = 0; 72 } 73 if (rnd8 > 15) { 74 while (rnd9 === 0) { 75 rnd9 = Math.floor(Math.random() * nm10.length); 76 } 77 } 78 rnd10 = Math.floor(Math.random() * nm11.length); 79 rnd11 = Math.floor(Math.random() * nm12.length); 80 names = nm1[rnd] + nm2[rnd2] + nm7[rnd5] + " " + nm3[rnd6] + nm8[rnd7] + nm9[rnd8] + nm10[rnd9] + nm11[rnd10] + nm12[rnd11]; 81 } else { 82 rnd = Math.floor(Math.random() * nm3.length); 83 rnd2 = Math.floor(Math.random() * nm4.length); 84 rnd3 = Math.floor(Math.random() * nm5.length); 85 rnd4 = Math.floor(Math.random() * nm7.length); 86 rnd6 = Math.floor(Math.random() * nm3.length); 87 rnd7 = Math.floor(Math.random() * nm8.length); 88 rnd8 = Math.floor(Math.random() * nm9.length); 89 rnd9 = Math.floor(Math.random() * nm10.length); 90 if (rnd8 < 16) { 91 rnd9 = 0; 92 } 93 if (rnd8 > 15) { 94 while (rnd9 === 0) { 95 rnd9 = Math.floor(Math.random() * nm10.length); 96 } 97 } 98 rnd10 = Math.floor(Math.random() * nm11.length); 99 rnd11 = Math.floor(Math.random() * nm12.length); 100 names = nm3[rnd] + nm4[rnd2] + nm5[rnd3] + nm7[rnd4] + " " + nm3[rnd6] + nm8[rnd7] + nm9[rnd8] + nm10[rnd9] + nm11[rnd10] + nm12[rnd11]; 101 } 102 } 103 br = document.createElement('br'); 104 element.appendChild(document.createTextNode(names)); 105 element.appendChild(br); 106 } 107 if (document.getElementById("result")) { 108 document.getElementById("placeholder").removeChild(document.getElementById("result")); 109 } 110 document.getElementById("placeholder").appendChild(element); 111 }