Thema: Delphi Schleifen

Einzelnen Beitrag anzeigen

marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#6

Re: Schleifen

  Alt 18. Sep 2005, 12:56
Hi,

versuche es mal so:

Delphi-Quellcode:
var
  iCount, iCol, iRow: integer;
begin
  Randomize;
  iCount := 0;
  with StringGrid do
    repeat
      iCol := Random(ColCount - FixedCols) + FixedCols;
      iRow := Random(RowCount - FixedRows) + FixedRows;
      if Objects[iCol, iRow] = Pointer(1) then
        Continue;
      Objects[iCol, iRow] := Pointer(1);
      Inc(iCount);
    until iCount = 5;
end;
Grüße vom marabu
  Mit Zitat antworten Zitat