Ver Mensaje Individual
  #11 (permalink)  
Antiguo 06/01/2016, 07:12
sincoz
 
Fecha de Ingreso: enero-2016
Mensajes: 6
Antigüedad: 8 años, 4 meses
Puntos: 0
Respuesta: Problema al realizar operaciones con parentesis

Muchas gracias rodocoyote15 he rediseñado el codigo tal como sigue y de momento no tengo ningun error.


<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
$nxn = array();

for($numeroactual=0; $numeroactual<=80; $numeroactual++){
$nxn[$numeroactual]= rand(1, 9);
if(Cpbl($numeroactual, $nxn) && (Cpbc($numeroactual, $nxn))=== TRUE){
$numeroactual--;
}
else{
echo $nxn[$numeroactual];
}
}




function Cpbl($numeroactual, $nxn){
if($numeroactual!=0){


$iniciox = (9*(round($numeroactual/9)));
for($iniciox; $iniciox < $numeroactual; $iniciox++){
if(($nxn[($numeroactual-1)]) === $iniciox){
return FALSE;
}
else{
return true;
}
}

}
}
function Cpbc($numeroactual, $nxn){
if($numeroactual <=8) {
$inicioy = ($numeroactual%9);
for($inicioy; $inicioy<= $numeroactual; $inicioy+9){
if($nxn[($numeroactual)] === $inicioy) {
return FALSE;
}
else{
return TRUE;
}

}


}
}


?>
</body>
</html>