* @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 tirada de Risk.
Atacante\n"; print "\n"; $numero1 = rand(1, 3); if ($numero1 == 1) { print "El atacante ataca con $numero1 dado:
\n"; } else { print "El atacante ataca con $numero1 dados:
\n"; } print "\n"; // Guardamos los valores del Atacante en la matriz $dados1 $dados1 = []; for ($i = 0; $i < $numero1; $i++) { $dados1[$i] = rand(1, 6); } // Ordenamos la matriz $dados1 y mostramos los resultados obtenidos por el Atacante rsort($dados1); print "\n";
foreach ($dados1 as $dado) {
print " \n";
}
print "
El defensor defiende con $numero2 dado:
\n"; } else { print "El defensor defiende con $numero2 dados:
\n"; } print "\n"; // Guardamos los valores del Defensor en la matriz $dados2 $dados2 = []; for ($i = 0; $i < $numero2; $i++) { $dados2[$i] = rand(1, 6); } // Ordenamos la matriz $dados2 y mostramos los resultados obtenidos por el Defensor rsort($dados2); print "\n";
foreach ($dados2 as $dado) {
print " \n";
}
print "
El atacante pierde $bajasAtacante unidad"; if ($bajasAtacante != 1) { print "es"; } print ". El defensor pierde $bajasDefensor unidad"; if ($bajasDefensor != 1) { print "es"; } print ".
\n"; print "\n"; ?>