Ver Mensaje Individual
  #7  
Antiguo 10-06-2010
Ruben_21 Ruben_21 is offline
Miembro
 
Registrado: dic 2007
Posts: 17
Reputación: 0
Ruben_21 Va por buen camino
Hola a todos que tal... aca posteo la solucion. Por si a alguien le sirve. Gracias a todos por las respuestas.

Saludos.
Código Delphi [-]procedure TForm1.Button4Click(Sender: TObject); var Ind1:Integer; Ind2:Integer; Cuenta:Integer; Aux:Integer; Cuenta2: Integer; begin CantidadParticipantes:=strtoint(Edit1.Text); CantidadParticipantes:=CantidadParticipantes+1; Form2.Memo1.Clear; SetLength(Participantes,CantidadParticipantes+2); for Cuenta:=1 to CantidadParticipantes do Participantes[Cuenta]:=Cuenta; Randomize; for Cuenta:=1 to (CantidadParticipantes+2)*3 do begin Ind1:=Random(CantidadParticipantes); if Ind1 = 0 then Ind1:=Ind1+1; Ind2:=Random(CantidadParticipantes); if Ind2 = 0 then Ind2:=Ind2+1; Aux:=Participantes[Ind1]; Participantes[Ind1]:= Participantes[Ind2]; Participantes[Ind2]:= Aux; end; for Cuenta2:=1 to CantidadParticipantes-1 do Form2.Memo1.Lines.Add(inttostr(Cuenta2)+'º Lugar Participante Nro: ' + inttostr(Participantes[Cuenta2])); Form2.ShowModal; Button4.Enabled:=False; Edit1.ReadOnly:=True; end;
Responder Con Cita