Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/12/2011, 11:01
JesusCova
 
Fecha de Ingreso: diciembre-2011
Mensajes: 26
Antigüedad: 12 años, 4 meses
Puntos: 4
Respuesta: Error en el código "Deprecated"

Ya te acomode los errores uno dejastes un parentesis abierto y el otro tenias ampersand al lado de las variables:

Código PHP:
Ver original
  1. /***********definición de constantes***********/
  2.    define ("NUMCARDS", 40);
  3.  
  4.     /***********declaración de funciones***********/
  5.  
  6.     function init_array ($vector, $valor)
  7.     {
  8.     for ($i=0; $i<NUMCARDS; $i++) {
  9.     $vector[i]=$valor;
  10.     }
  11.     }
  12.     function put_cards ($card_file)
  13.     {
  14.     print "<img src=".$card_file.".png>";
  15.     }
  16.    
  17.     function card_draw ($not_used, &$i, $card)
  18.     {
  19.     $not_used [$i]= rand (0,39);
  20.    
  21.     if ($not_used[$i]=true)
  22.     {
  23.     $card=$not_used[i];
  24.     $not_used[$i]=false;
  25.     }
  26.     else if ($not_used[$i]=false)
  27.     {
  28.     $i++;
  29.     }
  30.     return put_cards ($card);
  31. }
  32.  
  33.     /***********Programa principal*************/
  34.  
  35.     $not_used= array (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39);
  36.     $valor=true;
  37.     init_array ($not_used,$valor);
  38.     card_draw ($not_used,$i);