* @copyright 2025 Bartolomé Sintes Marco
* @license http://www.gnu.org/licenses/agpl.txt AGPL 3 or later
* @version 2025-02-08
* @link https://www.mclibre.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see
Actualice la página para mostrar una nueva partida de dados.
Jugador 1\n"; print "\n"; // Guardamos los valores del Jugador 1 en la matriz $dados1 $dados1 = []; for ($i = 0; $i < $numero; $i++) { $dados1[$i] = rand(1, 6); } // Mostramos los resultados obtenidos por el Jugador 1 print "\n";
for ($i = 0; $i < $numero; $i++) {
print " \n";
}
print "
\n";
for ($i = 0; $i < $numero; $i++) {
print " \n";
}
print "
El jugador 1 ha ganado $gana1 "; print $gana1 != 1 ? "veces" : "vez"; print ", el jugador 2 ha ganado $gana2 "; print $gana2 != 1 ? "veces" : "vez"; print " y los jugadores han empatado $empate "; print $empate != 1 ? "veces" : "vez"; print ".
\n"; print "\n"; // Mostramos quién ha ganado la partida if ($gana1 > $gana2) { print "En conjunto, ha ganado el jugador 1.
\n"; print "\n"; } elseif ($gana1 < $gana2) { print "En conjunto, ha ganado el jugador 2.
\n"; print "\n"; } else { print "En conjunto, han empatado.
\n"; print "\n"; } ?>