| ";
echo" | ";
echo"Nb joueur = ",$nb_inscrit_cat," ";
echo"Qe = ",$Qe," ";
echo"Qs = ",$Qs," ";
$D=$Qs;
while($D<$nb_inscrit_cat) {
$D=$D*2;
}
echo"Dimention tableau = ",$D," ";
$E=$D-$nb_inscrit_cat;
echo"Exempts = ",$E," ";
$NE=$nb_inscrit_cat-$E;
echo"Non Exempts = ",$NE," ";
$NPNE=$NE/2;
echo"NPNE(nb de pre-tours) = ",$NPNE," ";
$Ts=$D/4;
//$Ts=$Qs;
echo"Têtes de séries = ",$Ts," ";
$i=1;
$D2=$D;
for ($i;$i<=$Ts;$i=$i+1){
//echo $i;
$D2=$D2/2;
if ($D2<=$Ts) {
break;
}
}
$j=$Debut_tab;
for ($j;$j>=$Fin_tab;$j=$j-1){
//echo "$nb_inscrit_par_cat[$j]";
if ($nb_inscrit_par_cat[$j]!=0) {
$debut=$j;
break;
}
}
//if ($debut==$Qe) {
// $debut=$debut-1;
//}
$Nb_tour=$i;
echo "Nb tours:",$Nb_tour," ";
if ($Qe!=0) {
$Nb_comp=abs($Qe-$Qs);
}
else {
//echo "debut",$debut," ";
//echo $nb_inscrit_par_cat[$debut];
$Nb_comp=$nb_inscrit_par_cat[$debut]-$Qs;
}
echo "Nb compressions:",$Nb_comp," ";
echo " ";
if ($Qe==0) {
$Qe=$nb_inscrit_par_cat[$debut];
/*$m=0;
$h=0;
$j=1;
$reste=$NE;
for ($j;$j<=$NE;$j=$j+1){
$i=$Debut_tab;
//echo $j;
for ($i;$i>=$Fin_tab;$i=$i-1){
//echo "$nb_inscrit_par_cat[$i]";
$reste=$reste-$nb_inscrit_par_cat[$i];
//echo "reste :",$reste;
if ($reste<='0') {
$categ=$i;
$i=0;
$j=$NE;
}
}
}
echo" | ";
echo"";
$j=1;
for ($j;$j<=$Nb_tour;$j=$j+1){
echo"| Tour $j | ";
}
echo "TS | ";
$restant=0;
$i=$categ;
for ($i;$i<=$Debut_tab;$i=$i+1){
$restant=$restant+$nb_inscrit_par_cat[$i];
}
$i=$nb_inscrit_cat;
$dif=$restant-$NE;
$restant=$restant-$dif;
$i=1;
$x=5;
$y=1;
$z=2;
$Joueur[][]=0;
$Ts1=$Ts;
$Nb_comp1=$Nb_comp;
$Nb_comp2=$Nb_comp;
for ($i;$i<=$Ts;$i=$i+1){
//echo "i",$i;
//echo $restant;
//echo $h;
//echo "ts : ",$Ts1;
$x=$x-4;
$indice3=$indice2-$Ts1;
if ($restant>'0') {
$restant=$restant-2;
$indice=$nb_inscrit_cat-$h;
echo"[";
echo classement($classement_joueur[$indice]);
echo "(",$indice,")";
$Joueur[$x][$y]=$classement_joueur[$indice];
//echo $Joueur[$x][$y];
echo $x;
echo $y;
$y=$y+2;
echo "-";
if ($nb_inscrit_par_cat[$debut]>=$NE) {
$indice2=$indice-$NE/2-$h;
//echo "test";
}
else
{
//echo $Qe," - ",$nb_inscrit_cat;
$indice2=$nb_inscrit_cat-$nb_inscrit_par_cat[$debut]-$h;
//echo "test1";
}
echo classement($classement_joueur[$indice2]);
echo "(",$indice2,")";
$Joueur[$x][$y]=$classement_joueur[$indice2];
//echo $Joueur[$x][$y];
echo $x;
echo $y;
$y=$y+2;
echo"]";
//$h=0;
if ($Nb_comp1!=0) {
$h=$h+2;
$Nb_comp1=$Nb_comp1-1;
$restant=$restant-2;
$indice=$indice-1;
echo " [";
echo classement($classement_joueur[$indice]);
echo "(",$indice,")";
$Joueur[$x][$y]=$classement_joueur[$indice];
echo $x;
echo $y;
$y=$y+2;
echo "-";
if ($nb_inscrit_par_cat[$debut]>=$NE) {
$indice2=$indice-$NE/2;
//echo $test;
}
else
{
//echo $Qe," - ",$nb_inscrit_cat;
$indice2=$indice2-1;
}
echo classement($classement_joueur[$indice2]);
echo "(",$indice2,")";
echo"] | ";
}
else {
$h=$h+1;
echo"";
}
}
else echo" | ";
//echo $Nb_comp2;
//echo $h;echo $h1;
//$h1=$h;
if ($Nb_comp2!=0) {
echo"¤ | ";
$Nb_comp2=$Nb_comp2-1;
}
else {
if ($h1<$h) {
$h1=$h;
$m=$m+1;
$indice3=$indice3-$m;
//echo $indice3," - ",classement($classement_joueur[$indice3]);
echo"";
echo classement($classement_joueur[$indice3]);
echo "(",$indice3,")";
echo" | ";
}
else
{
$indice2=$indice2-1;
$indice=$indice-1;
//echo $indice2," / ",classement($classement_joueur[$indice2]);
echo"[";
echo classement($classement_joueur[$indice]);
echo "(",$indice,")";
echo "-";
echo classement($classement_joueur[$indice2]);
echo "(",$indice2,")";
echo"] | ";
}
}
echo"$Ts1 | ";
$Ts1=$Ts1-1;
}
echo" ";*/
}
//else
//{
$m=-1;
$h=0;
$j=1;
$reste=$NE;
for ($j;$j<=$NE;$j=$j+1){
$i=$Debut_tab;
//echo $j;
for ($i;$i>=$Fin_tab;$i=$i-1){
//echo "$nb_inscrit_par_cat[$i]";
$reste=$reste-$nb_inscrit_par_cat[$i];
//echo "reste :",$reste;
if ($reste<='0') {
$categ=$i;
$i=0;
$j=$NE;
}
}
}
echo" | ";
echo"";
$j=1;
for ($j;$j<=$Nb_tour;$j=$j+1){
echo"| Tour $j | ";
}
echo "TS | ";
$restant=0;
$i=$categ;
for ($i;$i<=$Debut_tab;$i=$i+1){
$restant=$restant+$nb_inscrit_par_cat[$i];
}
$i=$nb_inscrit_cat;
/*for ($i;$i>0;$i=$i-1){
echo " i :$i - ",classement($classement_joueur[$i])," / ";
}*/
$dif=$restant-$NE;
$restant=$restant-$dif;
$i=1;
$x=5;
$y=1;
$z=2;
$Joueur[][]=0;
$Ts1=$Ts;
$Nb_comp1=$Nb_comp;
$Nb_comp2=$Nb_comp;
for ($i;$i<=$Ts;$i=$i+1){
//echo "i",$i;
//echo $restant;
//echo $h;
//echo "ts : ",$Ts1;
$x=$x-4;
if ($restant>'0') {
$restant=$restant-2;
$indice=$nb_inscrit_cat-$h;
echo"[";
echo classement($classement_joueur[$indice]);
echo "(",$indice,")";
$Joueur[$x][$y]=$classement_joueur[$indice];
//echo $Joueur[$x][$y];
echo $x;
echo $y;
$y=$y+2;
echo "-";
if ($nb_inscrit_par_cat[$debut]>=$NE) {
$indice2=$indice-$NE/2-$h;
echo $test;
}
else
{
//echo $Qe," - ",$nb_inscrit_cat;
$indice2=$nb_inscrit_cat-$Qe-$h;
}
echo classement($classement_joueur[$indice2]);
echo "(",$indice2,")";
$Joueur[$x][$y]=$classement_joueur[$indice2];
//echo $Joueur[$x][$y];
echo $x;
echo $y;
$y=$y+2;
echo"]";
//$h=0;
if ($Nb_comp1!=0) {
$h=$h+2;
$Nb_comp1=$Nb_comp1-1;
$restant=$restant-2;
$indice=$indice-1;
echo " [";
echo classement($classement_joueur[$indice]);
echo "(",$indice,")";
$Joueur[$x][$y]=$classement_joueur[$indice];
echo $x;
echo $y;
$y=$y+2;
echo "-";
if ($nb_inscrit_par_cat[$debut]>=$NE) {
$indice2=$indice-$NE/2;
echo $test;
}
else
{
//echo $Qe," - ",$nb_inscrit_cat;
$indice2=$indice2-1;
}
echo classement($classement_joueur[$indice2]);
echo "(",$indice2,")";
$Joueur[$x][$y]=$classement_joueur[$indice2];
echo $x;
echo $y;
$y=$y+2;
echo"] | ";
}
else {
$h=$h+1;
$y=$y+4;
echo"";
}
echo $indice2;echo $Ts1;
$indice3=$indice2-$Ts1;
}
else echo" | ";
//echo $Nb_comp2;
//echo $h;echo $h1;
//$h1=$h;
$x=$x+4;
if ($Nb_comp2!=0) {
echo"¤";
$z=$z+2;
$Joueur[$x][$z]='¤';
echo $x;
echo $z;
$z=$z+6;
echo" | ";
$Nb_comp2=$Nb_comp2-1;
}
else {
if ($h1<$h) {
$h1=$h;
$m=$m+1;
$z=$z+4;
//$indice3=$indice3-$m;
$indice3=$indice3-$m;
//echo $indice3," - ",classement($classement_joueur[$indice3]);
echo"";
echo classement($classement_joueur[$indice3]);
echo "(",$indice3,")";
$Joueur[$x][$z]=$classement_joueur[$indice3];
echo $x;
echo $z;
$z=$z+4;
echo" | ";
}
else
{
$indice2=$indice2-1;
$indice=$indice-1;
//echo $indice2," / ",classement($classement_joueur[$indice2]);
echo"[";
echo classement($classement_joueur[$indice]);
echo "(",$indice,")";
$Joueur[$x][$z]=$classement_joueur[$indice];
echo $x;
echo $z;
$z=$z+4;
echo "-";
echo classement($classement_joueur[$indice2]);
echo "(",$indice2,")";
$Joueur[$x][$z]=$classement_joueur[$indice2];
echo $x;
echo $z;
$z=$z+4;
echo"] | ";
}
}
echo"$Ts1 | ";
$Ts1=$Ts1-1;
}
echo" ";
//}
echo" |