Blame lazarus/text-effect/unit1.pas
|
|
6e39ef |
unit Unit1;
|
|
|
6e39ef |
|
|
|
6e39ef |
{$mode objfpc}{$H+}
|
|
|
6e39ef |
|
|
|
6e39ef |
interface
|
|
|
6e39ef |
|
|
|
6e39ef |
uses
|
|
|
6e39ef |
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
|
|
6e39ef |
ExtCtrls;
|
|
|
6e39ef |
|
|
|
6e39ef |
type
|
|
|
6e39ef |
|
|
|
6e39ef |
{ TForm1 }
|
|
|
6e39ef |
|
|
|
6e39ef |
TForm1 = class(TForm)
|
|
|
6e39ef |
Edit1: TEdit;
|
|
|
6e39ef |
Edit2: TEdit;
|
|
|
6e39ef |
Timer1: TTimer;
|
|
|
6e39ef |
procedure Timer1Timer(Sender: TObject);
|
|
|
6e39ef |
private
|
|
|
6e39ef |
{ private declarations }
|
|
|
6e39ef |
public
|
|
|
6e39ef |
{ public declarations }
|
|
|
6e39ef |
end;
|
|
|
6e39ef |
|
|
|
6e39ef |
var
|
|
|
6e39ef |
Form1: TForm1;
|
|
|
6e39ef |
|
|
|
6e39ef |
implementation
|
|
|
6e39ef |
|
|
|
6e39ef |
{$R *.lfm}
|
|
|
6e39ef |
|
|
|
6e39ef |
{ TForm1 }
|
|
|
6e39ef |
|
|
|
6e39ef |
procedure TForm1.Timer1Timer(Sender: TObject);
|
|
|
6e39ef |
var
|
|
|
6e39ef |
i, j: integer;
|
|
|
6e39ef |
text1, text2, chars: string;
|
|
|
6e39ef |
begin
|
|
|
6e39ef |
text1 := Edit1.Text;
|
|
|
6e39ef |
text2 := Edit2.Text;
|
|
|
6e39ef |
chars := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + text1;
|
|
|
6e39ef |
|
|
|
6e39ef |
for i := 1 to length(text1) do begin
|
|
|
6e39ef |
if length(text2) < i then text2 := text2 + '*';
|
|
|
6e39ef |
for j := 0 to 0 do
|
|
|
6e39ef |
if text1[i] <> text2[i] then text2[i] := chars[Random(length(chars)+1)];
|
|
|
6e39ef |
end;
|
|
|
6e39ef |
|
|
|
6e39ef |
Edit2.Text := copy(text2, 1, length(text1));
|
|
|
6e39ef |
end;
|
|
|
6e39ef |
|
|
|
6e39ef |
end.
|
|
|
6e39ef |
|