Function GenereNom($NbLettreMax) {
$consonne = array("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","z");
$voyelle = array("a","e","i","o","u","y");
$nblettre = rand(3, $NbLettreMax);
$nom="";
$i=0;
$cons=1;
$voye=0;
do {
if ($cons==1) {
$voco=1;
$cons=0;
}
else if ($voye == 2 ) {
$voco=0;
$voye=0;
}
else $voco = rand(0,1);
if ($voco == 0 ) {
$nombal= rand (0,19);
$nom=$nom.$consonne[$nombal];
$cons++;
} else {
$nombal= rand (0,5);
$nom=$nom.$voyelle[$nombal];
$voye++;
}
// echo "Étape=$i - Nb consonne succ=$cons Nb voyelle succ=$voye Voy ou Cons?=$voco Nom=$nom
";
$i++;
} while ($i < $nblettre);
$nom= ucfirst($nom);
if ($NbSuffixe !=0) $nom=$nom.$suffixe[$NbSuffixe];
// echo "#$y: $nom
";
return $nom;
}
Function GenereNomSyl($NbSylla) {
$consonne = array("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","z");
$voyelle = array("a","e","i","o","u","y");
$nbrepet=0;
$nom ="";
do {
$nombal= rand (0,19);
$ConsAl = $consonne[$nombal];
$nombal = rand (0,5);
$VoyeAl = $voyelle[$nombal];
$StrucSyl = rand (1,4);
Switch ($StrucSyl) {
case 1: // CVC
$nom = $nom . $ConsAl . $VoyeAl . $ConsAl;
break;
case 2: // VC
$nom = $nom . $VoyeAl . $ConsAl;
break;
case 3: // CV
$nom = $nom . $ConsAl . $VoyeAl;
break;
case 4: // V
$nom = $nom . $VoyeAl;
break;
}
$nbrepet++;
// echo "$nbrepet
";
} while ($nbrepet < $NbSylla);
$nom= ucfirst($nom);
return $nom;
}
?>
D3 1 1 3 2 3 2 2 3 1 3 | D4 2 4 2 2 3 1 1 2 3 2 | D6 1 3 6 1 1 5 1 5 4 3 | D8 5 4 6 5 2 2 5 6 6 2 | D10 10 1 9 1 4 4 5 3 9 3 | D12 4 12 9 8 7 5 1 6 1 4 | D20 20 6 16 17 11 4 12 13 10 1 | D30 18 1 22 16 23 2 13 21 8 22 | D100 35 47 2 97 80 47 70 3 41 76 |