Wegen dem
var
Delphi-Quellcode:
procedure Shuffle(var s: String);
begin
...
end;
Ok, und sonst könnte es auch so gehen, oder?
Delphi-Quellcode:
function Shuffle(s: String): String;
var
i, j: integer;
temp : Char;
begin
for i := length(s) downto 1 do
begin
j := Random(i)+1;
temp := s[i];
s[i] := s[j];
s[j] := temp;
end;
Result := s;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
s: String;
begin
s:= Edit1.Text;
shuffle(s);
Edit1.Text:=s;
end;