Blob Blame Raw
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  ExtCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Timer1Timer(Sender: TObject);
var
  i, j: integer;
  text1, text2, chars: string;
begin
  text1 := Edit1.Text;
  text2 := Edit2.Text;
  chars := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + text1;

  for i := 1 to length(text1) do begin
    if length(text2) < i then text2 := text2 + '*';
    for j := 0 to 0 do
      if text1[i] <> text2[i] then text2[i] := chars[Random(length(chars)+1)];
  end;

  Edit2.Text := copy(text2, 1, length(text1));
end;

end.