Tema: random
Ver Mensaje Individual
  #2  
Antiguo 24-11-2005
Avatar de epuigdef
epuigdef epuigdef is offline
Miembro
 
Registrado: jul 2005
Posts: 196
Reputación: 19
epuigdef Va por buen camino
Prueba cambiando el código por:


Código Delphi [-]
randomize;
u:= random(random(1));
if (u < 0.1) then
N:=0
else
if (u>=0.1) AND (u < 0.2)then
N:=1
else
if (u >=0.2) AND (u < 0.45)then
N:=2
else
if (u >= 0.45) and (u < 0.75)then
N:=3
else
if (u >= 1)
N=4;
Edu
Responder Con Cita