Skip to content
Extraits de code Groupes Projets
Valider a54f498a rédigé par Eliah REBSTOCK's avatar Eliah REBSTOCK
Parcourir les fichiers

ajout de somme dans le test du classement ELO

parent 7ee8671e
Branches
Aucune étiquette associée trouvée
2 requêtes de fusion!21Merge de Dev dans Master,!2Dev phoenix
...@@ -70,7 +70,7 @@ function ELO($scores_actuel, $scores_obtenus, $K, $D) ...@@ -70,7 +70,7 @@ function ELO($scores_actuel, $scores_obtenus, $K, $D)
} }
/* Test */ /* Test */
print("<html><body><table><th>Itération</th><th>Joueur 1</th><th>Joueur 2</th><th>Joueur 3</th><th>Joueur 4</th><th>Joueur 5</th></tr>"); print("<html><body><table><th>Itération</th><th>Joueur 1</th><th>Joueur 2</th><th>Joueur 3</th><th>Joueur 4</th><th>Joueur 5</th><th>Somme</th></tr>");
$sa = array(-2,-1,0,1,2); $sa = array(-2,-1,0,1,2);
$DS = array(1000,1000,1000,1000,1000); $DS = array(1000,1000,1000,1000,1000);
...@@ -78,8 +78,11 @@ print("<tr><td>0</td>"); ...@@ -78,8 +78,11 @@ print("<tr><td>0</td>");
foreach ($DS as $value) { foreach ($DS as $value) {
print("<td>$value</td>"); print("<td>$value</td>");
} }
print("</tr>"); $p = array_sum($DS);
$j = 1; print("<td>$p</td></tr>");
for($j=1;$j<20;$j++){
$sa = array(-2,-1,0,1,2);
$res = ELO($DS, $sa, 32, 400); $res = ELO($DS, $sa, 32, 400);
print("<tr><td>$j</td>"); print("<tr><td>$j</td>");
for ($i=0;$i<count($DS);$i++) { for ($i=0;$i<count($DS);$i++) {
...@@ -88,8 +91,9 @@ $j = 1; ...@@ -88,8 +91,9 @@ $j = 1;
$k2 = $res[$i]; $k2 = $res[$i];
print("<td>$k1 ($k2)</td>"); print("<td>$k1 ($k2)</td>");
} }
print("</tr>"); $p = array_sum($DS);
$j = 2; print("<td>$p</td></tr>");
$j++;
$sa = array(2,1,0,-1,-2); $sa = array(2,1,0,-1,-2);
$res = ELO($DS, $sa, 32, 400); $res = ELO($DS, $sa, 32, 400);
...@@ -100,8 +104,10 @@ for ($i=0;$i<count($DS);$i++) { ...@@ -100,8 +104,10 @@ for ($i=0;$i<count($DS);$i++) {
$k2 = $res[$i]; $k2 = $res[$i];
print("<td>$k1 ($k2)</td>"); print("<td>$k1 ($k2)</td>");
} }
print("</tr>"); $p = array_sum($DS);
print("<td>$p</td></tr>");
}
print("</table></body></html>"); print("</table></body></html>");
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter