unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Sorty, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Image5: TImage;
    Image6: TImage;
    Label6: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
     a:array[1..6] of TThread;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  p:pole;
  i:integer;
begin
  Button1.Enabled:=false;
  SetLength(p,Image1.Width);
  for i:=0 to high(p) do p[i]:=random(Image1.Height);
  a[1]:=TBubbleSort.Create(p,Image1);
  a[2]:=TInsertSort.Create(p,Image2);
  a[3]:=TMinSort.Create(p,Image3);
  a[4]:=TQuickSort.Create(p,Image4);
  a[5]:=THeapSort.Create(p,Image5);
  for i:=1 to 5 do a[i].Resume;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  randomize;
  doubleBuffered:=true;
end;

end.
