Classement des joueurs
continuous-integration/drone/push Build is passing Details

dans l'ordre en fin de partie
ServeurDeTest
Noé GARNIER 2 years ago
parent f03b07dbbd
commit e1a60b6e7e

@ -211,6 +211,7 @@ class UserModel
$maxPoints = max($lesPoints); $maxPoints = max($lesPoints);
$maxIndex = array_keys($lesPoints, $maxPoints)[0]; $maxIndex = array_keys($lesPoints, $maxPoints)[0];
$vainqueur = $lesJoueurs[$maxIndex]; $vainqueur = $lesJoueurs[$maxIndex];
array_multisort($lesPoints, SORT_DESC, $lesJoueurs, $lesTemps);
return array($lesJoueurs, $lesPoints, $lesTemps, $vainqueur); return array($lesJoueurs, $lesPoints, $lesTemps, $vainqueur);
} }
public function checkGameIsEnd(int $idPartie) : bool{ public function checkGameIsEnd(int $idPartie) : bool{

@ -32,7 +32,7 @@
$i = 0; $i = 0;
for ($i; $i < $playerNumberPerGame; $i++) { for ($i; $i < $playerNumberPerGame; $i++) {
echo "<tr>"; echo "<tr>";
echo "<th scope='row'> X </th>"; echo "<th scope='row'> " . $i+1 . "</th>";
echo "<td>" . $lesInfos[0][$i]->getPseudo() . "</td>"; echo "<td>" . $lesInfos[0][$i]->getPseudo() . "</td>";
echo "<td>" . $lesInfos[1][$i] . "</td>"; echo "<td>" . $lesInfos[1][$i] . "</td>";
echo "<td>" . $lesInfos[2][$i] . "</td>"; echo "<td>" . $lesInfos[2][$i] . "</td>";

Loading…
Cancel
Save