unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    RadioButton4: TRadioButton;
    Label2: TLabel;
    Button3: TButton;
    Button4: TButton;
    Image1: TImage;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    Timer1: TTimer;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
function RebuildTest(ing:integer;st:string):integer;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Timer1Timer(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  cicle,level,vidp,sprvidp,othlev,i:integer;
  s1,s2,s3,s4,s5,s6,lang:string;
  mark:real;
  vartest:array[1..26]of integer;
  f1:textfile;
  vidps:array[1..4] of string;
  tim:integer;
implementation

{$R *.dfm}

function Unic(var flag: array of boolean; range: integer): integer;
begin
  result := random(range);
  while flag[result] do
    result := random(range);
  flag[result] := true;
end;

procedure MassRand(range: integer; var inputMass: array of integer);
var
  i1: integer;
  bm: array of boolean;
begin
  SetLength(bm, length(inputMass));
  for i1 := 0 to length(inputMass) - 1 do
  begin
    inputMass[i1] := Unic(bm, range) + 1;
  end;
end;


procedure ConvToLev(ing:integer);
begin
cicle:=1;
level:=1;
cicle:=cicle+trunc(ing/6);
level:=ing-((cicle-1)*6);
if level=0 then begin
cicle:=cicle-1;
level:=6;
end;
end;

function tform1.RebuildTest(ing:integer;st:string):integer;
begin
if cicle=5 then
case ing of
1:begin
image5.show;
label1.Caption:=s1+'sin A';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image5.Picture.Bitmap.LoadFromFile('triang.bmp');
image1.Picture.Bitmap.LoadFromFile('17.bmp');
image2.Picture.Bitmap.LoadFromFile('15.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('18.bmp');
image4.Picture.Bitmap.LoadFromFile('16.bmp');
writeln(f1,s1+'sin A');
writeln(f1,'17.bmp');
writeln(f1,'15.bmp');
writeln(f1,'18.bmp');
writeln(f1,'16.bmp');
writeln(f1,'');
result:=3;
vidps[1]:='17.bmp';
vidps[2]:='15.bmp';
vidps[3]:='18.bmp';
vidps[4]:='16.bmp';
end;
2:begin
image5.Show;
label1.Caption:=s1+'cos A';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image5.Picture.Bitmap.LoadFromFile('triang.bmp');
image1.Picture.Bitmap.LoadFromFile('17.bmp');
image2.Picture.Bitmap.LoadFromFile('18.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('15.bmp');
image4.Picture.Bitmap.LoadFromFile('16.bmp');
writeln(f1,s1+'cos A');
writeln(f1,'17.bmp');
writeln(f1,'18.bmp');
writeln(f1,'15.bmp');
writeln(f1,'16.bmp');
writeln(f1,'');
result:=1;
vidps[1]:='17.bmp';
vidps[2]:='18.bmp';
vidps[3]:='15.bmp';
vidps[4]:='16.bmp';
end;
end
else
if cicle=4 then
case ing of
1:begin
label1.Caption:=s1+'sin(90°-a)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image1.Picture.Bitmap.LoadFromFile('7.bmp');
image2.Picture.Bitmap.LoadFromFile('10.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('8.bmp');
image4.Picture.Bitmap.LoadFromFile('12.bmp');
writeln(f1,s1+'sin(90°-a)');
writeln(f1,'7.bmp');
writeln(f1,'10.bmp');
writeln(f1,'8.bmp');
writeln(f1,'12.bmp');
writeln(f1,'');
result:=3;
vidps[1]:='7.bmp';
vidps[2]:='10.bmp';
vidps[3]:='8.bmp';
vidps[4]:='12.bmp';
end;
2:begin
label1.Caption:=s1+'cos(90°-a)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image1.Picture.Bitmap.LoadFromFile('8.bmp');
image2.Picture.Bitmap.LoadFromFile('9.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('12.bmp');
image4.Picture.Bitmap.LoadFromFile('11.bmp');
writeln(f1,s1+'cos(90°-a)');
writeln(f1,'8.bmp');
writeln(f1,'9.bmp');
writeln(f1,'12.bmp');
writeln(f1,'11.bmp');
writeln(f1,'');
result:=2;
vidps[1]:='8.bmp';
vidps[2]:='9.bmp';
vidps[3]:='12.bmp';
vidps[4]:='11.bmp';
end;
3:begin
label1.Caption:=s1+'tg(90°-a)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image1.Picture.Bitmap.LoadFromFile('12.bmp');
image2.Picture.Bitmap.LoadFromFile('7.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('10.bmp');
image4.Picture.Bitmap.LoadFromFile('13.bmp');
writeln(f1,s1+'tg(90°-a)');
writeln(f1,'12.bmp');
writeln(f1,'7.bmp');
writeln(f1,'10.bmp');
writeln(f1,'13.bmp');
writeln(f1,'');
result:=4;
vidps[1]:='12.bmp';
vidps[2]:='7.bmp';
vidps[3]:='10.bmp';
vidps[4]:='13.bmp';
end;
4:begin
label1.Caption:=s1+'sin(180°-a)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image1.Picture.Bitmap.LoadFromFile('9.bmp');
image2.Picture.Bitmap.LoadFromFile('7.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('12.bmp');
image4.Picture.Bitmap.LoadFromFile('11.bmp');
writeln(f1,s1+'sin(180°-a)');
writeln(f1,'9.bmp');
writeln(f1,'7.bmp');
writeln(f1,'12.bmp');
writeln(f1,'11.bmp');
writeln(f1,'');
result:=1;
vidps[1]:='9.bmp';
vidps[2]:='7.bmp';
vidps[3]:='12.bmp';
vidps[4]:='11.bmp';
end;
5:begin
label1.Caption:=s1+'cos(180°-a)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image1.Picture.Bitmap.LoadFromFile('8.bmp');
image2.Picture.Bitmap.LoadFromFile('7.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('12.bmp');
image4.Picture.Bitmap.LoadFromFile('11.bmp');
writeln(f1,s1+'cos(180°-a)');
writeln(f1,'8.bmp');
writeln(f1,'7.bmp');
writeln(f1,'12.bmp');
writeln(f1,'11.bmp');
writeln(f1,'');
result:=2;
vidps[1]:='8.bmp';
vidps[2]:='7.bmp';
vidps[3]:='12.bmp';
vidps[4]:='11.bmp';
end;
6:begin
label1.Caption:=s1+'tg(180°-a)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
image1.Picture.Bitmap.LoadFromFile('8.bmp');
image2.Picture.Bitmap.LoadFromFile('7.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('12.bmp');
image4.Picture.Bitmap.LoadFromFile('11.bmp');
writeln(f1,s1+'tg(180°-a)');
writeln(f1,'8.bmp');
writeln(f1,'7.bmp');
writeln(f1,'12.bmp');
writeln(f1,'11.bmp');
writeln(f1,'');
result:=4;
vidps[1]:='8.bmp';
vidps[2]:='7.bmp';
vidps[3]:='12.bmp';
vidps[4]:='11.bmp';
end;
end
else
case ing of
1:begin
label1.Caption:=s1+st+'(30°)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='-';
if st='sin' then begin
writeln(f1,s1+st+'(30°)');
writeln(f1,'2.bmp');
writeln(f1,'1.bmp');
writeln(f1,'3.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('2.bmp');
image2.Picture.Bitmap.LoadFromFile('1.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('3.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=2;
vidps[1]:='2.bmp';
vidps[2]:='1.bmp';
vidps[3]:='3.bmp';
vidps[4]:='-4.bmp';
end;
if st='cos' then begin
writeln(f1,s1+st+'(30°)');
writeln(f1,'1.bmp');
writeln(f1,'2.bmp');
writeln(f1,'3.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('1.bmp');
image2.Picture.Bitmap.LoadFromFile('2.bmp');
image3.Picture.Bitmap.LoadFromFile('3.bmp');  {x}
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=3;
vidps[1]:='1.bmp';
vidps[2]:='2.bmp';
vidps[3]:='3.bmp';
vidps[4]:='-4.bmp';
end;
if st='tg' then begin
writeln(f1,s1+st+'(30°)');
writeln(f1,'6.bmp');
writeln(f1,'5.bmp');
writeln(f1,'1.bmp');
writeln(f1,'-3.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('6.bmp');   {x}
image2.Picture.Bitmap.LoadFromFile('5.bmp');
image3.Picture.Bitmap.LoadFromFile('1.bmp');
image4.Picture.Bitmap.LoadFromFile('3.bmp');
result:=1;
vidps[1]:='6.bmp';
vidps[2]:='5.bmp';
vidps[3]:='1.bmp';
vidps[4]:='-3.bmp';
end;
end;
2:begin
label1.Caption:=s1+st+'(45°)';
radiobutton1.Caption:='';
radiobutton2.Caption:='';
radiobutton3.Caption:='-';
radiobutton4.Caption:='';
if st='sin' then begin
writeln(f1,s1+st+'(45°)');
writeln(f1,'6.bmp');
writeln(f1,'2.bmp');
writeln(f1,'-2.bmp');
writeln(f1,'4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('6.bmp');
image2.Picture.Bitmap.LoadFromFile('2.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('2.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=2;
vidps[1]:='6.bmp';
vidps[2]:='2.bmp';
vidps[3]:='-2.bmp';
vidps[4]:='4.bmp';
end;
if st='cos' then begin
writeln(f1,s1+st+'(45°)');
writeln(f1,'2.bmp');
writeln(f1,'6.bmp');
writeln(f1,'-3.bmp');
writeln(f1,'1.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('2.bmp');   {x}
image2.Picture.Bitmap.LoadFromFile('6.bmp');
image3.Picture.Bitmap.LoadFromFile('3.bmp');
image4.Picture.Bitmap.LoadFromFile('1.bmp');
result:=1;
vidps[1]:='2.bmp';
vidps[2]:='6.bmp';
vidps[3]:='-3.bmp';
vidps[4]:='1.bmp';
end;
if st='tg' then begin
writeln(f1,s1+st+'(45°)');
writeln(f1,'3.bmp');
writeln(f1,'2.bmp');
writeln(f1,'-1.bmp');
writeln(f1,'4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('3.bmp');
image2.Picture.Bitmap.LoadFromFile('2.bmp');
image3.Picture.Bitmap.LoadFromFile('1.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');   {x}
result:=4;
vidps[1]:='3.bmp';
vidps[2]:='2.bmp';
vidps[3]:='-1.bmp';
vidps[4]:='4.bmp';
end;
end;
3:begin
label1.Caption:=s1+st+'(60°)';
radiobutton1.Caption:='-';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='';
if st='sin' then begin
writeln(f1,s1+st+'(60°)');
writeln(f1,'-6.bmp');
writeln(f1,'3.bmp');
writeln(f1,'2.bmp');
writeln(f1,'4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('6.bmp');
image2.Picture.Bitmap.LoadFromFile('3.bmp'); {x}
image3.Picture.Bitmap.LoadFromFile('2.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=2;
vidps[1]:='-6.bmp';
vidps[2]:='3.bmp';
vidps[3]:='2.bmp';
vidps[4]:='4.bmp';
end;
if st='cos' then begin
writeln(f1,s1+st+'(60°)');
writeln(f1,'-2.bmp');
writeln(f1,'6.bmp');
writeln(f1,'1.bmp');
writeln(f1,'4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('2.bmp');
image2.Picture.Bitmap.LoadFromFile('6.bmp');
image3.Picture.Bitmap.LoadFromFile('1.bmp');    {x}
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=3;
vidps[1]:='-2.bmp';
vidps[2]:='6.bmp';
vidps[3]:='1.bmp';
vidps[4]:='4.bmp';
end;
if st='tg' then begin
writeln(f1,s1+st+'(60°)');
writeln(f1,'-4.bmp');
writeln(f1,'2.bmp');
writeln(f1,'1.bmp');
writeln(f1,'5.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('4.bmp');
image2.Picture.Bitmap.LoadFromFile('2.bmp');
image3.Picture.Bitmap.LoadFromFile('1.bmp');
image4.Picture.Bitmap.LoadFromFile('5.bmp');    {x}
result:=4;
vidps[1]:='-4.bmp';
vidps[2]:='2.bmp';
vidps[3]:='1.bmp';
vidps[4]:='5.bmp';
end;
end;
4:begin
label1.Caption:=s1+st+'(150°)';
radiobutton1.Caption:='';
radiobutton2.Caption:='-';
radiobutton3.Caption:='';
radiobutton4.Caption:='-';
result:=2;
if st='sin' then begin
writeln(f1,s1+st+'(150°)');
writeln(f1,'3.bmp');
writeln(f1,'-1.bmp');
writeln(f1,'5.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('3.bmp');
image3.Picture.Bitmap.LoadFromFile('1.bmp'); {x}
image2.Picture.Bitmap.LoadFromFile('5.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=3;
vidps[1]:='3.bmp';
vidps[2]:='-1.bmp';
vidps[3]:='5.bmp';
vidps[4]:='-4.bmp';
end;
if st='cos' then begin
writeln(f1,s1+st+'(150°)');
writeln(f1,'3.bmp');
writeln(f1,'-3.bmp');
writeln(f1,'1.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('2.bmp');
image2.Picture.Bitmap.LoadFromFile('3.bmp');    {x}
image3.Picture.Bitmap.LoadFromFile('1.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');
vidps[1]:='3.bmp';
vidps[2]:='-3.bmp';
vidps[3]:='1.bmp';
vidps[4]:='-4.bmp';
end;
if st='tg' then begin
writeln(f1,s1+st+'(150°)');
writeln(f1,'4.bmp');
writeln(f1,'-6.bmp');
writeln(f1,'1.bmp');
writeln(f1,'-5.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('4.bmp');
image2.Picture.Bitmap.LoadFromFile('6.bmp');      {x}
image3.Picture.Bitmap.LoadFromFile('1.bmp');
image4.Picture.Bitmap.LoadFromFile('5.bmp');
vidps[1]:='4.bmp';
vidps[2]:='-6.bmp';
vidps[3]:='1.bmp';
vidps[4]:='-5.bmp';
end;
end;
5:begin
label1.Caption:=s1+st+'(135°)';
radiobutton1.Caption:='-';
radiobutton2.Caption:='';
radiobutton3.Caption:='';
radiobutton4.Caption:='-';
result:=3;
if st='sin' then begin
writeln(f1,s1+st+'(135°)');
writeln(f1,'-5.bmp');
writeln(f1,'1.bmp');
writeln(f1,'2.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('5.bmp');
image2.Picture.Bitmap.LoadFromFile('1.bmp');
image3.Picture.Bitmap.LoadFromFile('2.bmp');  {x}
image4.Picture.Bitmap.LoadFromFile('4.bmp');
vidps[1]:='-5.bmp';
vidps[2]:='1.bmp';
vidps[3]:='2.bmp';
vidps[4]:='-4.bmp';
end;
if st='cos' then begin
writeln(f1,s1+st+'(135°)');
writeln(f1,'-2.bmp');
writeln(f1,'3.bmp');
writeln(f1,'2.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('2.bmp');
image2.Picture.Bitmap.LoadFromFile('3.bmp');
image3.Picture.Bitmap.LoadFromFile('2.bmp');     {x}
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=1;
vidps[1]:='-2.bmp';
vidps[2]:='3.bmp';
vidps[3]:='2.bmp';
vidps[4]:='-4.bmp';
end;
if st='tg' then begin
writeln(f1,s1+st+'(135°)');
writeln(f1,'-3.bmp');
writeln(f1,'1.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'-5.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('3.bmp');
image2.Picture.Bitmap.LoadFromFile('1.bmp');
image3.Picture.Bitmap.LoadFromFile('4.bmp');     {x}
image4.Picture.Bitmap.LoadFromFile('5.bmp');
radiobutton3.caption:='-';
vidps[1]:='-3.bmp';
vidps[2]:='1.bmp';
vidps[3]:='-4.bmp';
vidps[4]:='-5.bmp';
end;
end;
6:begin
label1.Caption:=s1+st+'(120°)';
radiobutton1.Caption:='-';
radiobutton2.Caption:='';
radiobutton3.Caption:='-';
radiobutton4.Caption:='';
result:=1;
if st='sin' then begin
writeln(f1,s1+st+'(120°)');
writeln(f1,'- 3.bmp');
writeln(f1,'6.bmp');
writeln(f1,'- 2.bmp');
writeln(f1,'4.bmp');
writeln(f1,'');
image2.Picture.Bitmap.LoadFromFile('3.bmp');   {x}
image1.Picture.Bitmap.LoadFromFile('6.bmp');
image3.Picture.Bitmap.LoadFromFile('2.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');
result:=2;
vidps[1]:='-3.bmp';
vidps[2]:='6.bmp';
vidps[3]:='-2.bmp';
vidps[4]:='4.bmp';
end;
if st='cos' then begin
writeln(f1,s1+st+'(120°)');
writeln(f1,'-1.bmp');
writeln(f1,'5.bmp');
writeln(f1,'-2.bmp');
writeln(f1,'4.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('1.bmp');      {x}
image2.Picture.Bitmap.LoadFromFile('5.bmp');
image3.Picture.Bitmap.LoadFromFile('2.bmp');
image4.Picture.Bitmap.LoadFromFile('4.bmp');
vidps[1]:='-1.bmp';
vidps[2]:='5.bmp';
vidps[3]:='-2.bmp';
vidps[4]:='4.bmp';
end;
if st='tg' then begin
writeln(f1,s1+st+'(120°)');
writeln(f1,'-5.bmp');
writeln(f1,'1.bmp');
writeln(f1,'-4.bmp');
writeln(f1,'5.bmp');
writeln(f1,'');
image1.Picture.Bitmap.LoadFromFile('5.bmp');      {x}
image2.Picture.Bitmap.LoadFromFile('1.bmp');
image3.Picture.Bitmap.LoadFromFile('4.bmp');
image4.Picture.Bitmap.LoadFromFile('5.bmp');
vidps[1]:='-5.bmp';
vidps[2]:='1.bmp';
vidps[3]:='-4.bmp';
vidps[4]:='5.bmp';
end;
end;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
randomize;
//for i:=1 to  do vartest[i]:=random(26)+1;
unit1.MassRand(26,vartest);
tim:=0;
I:=1;
label2.Caption:='';
label1.Caption:='';
label4.Caption:='';
radiobutton1.Visible:=false;
radiobutton2.Visible:=false;
radiobutton3.Visible:=false;
radiobutton4.Visible:=false;
button3.Visible:=false;
button4.Visible:=false;

end;

procedure TForm1.Button2Click(Sender: TObject);
begin
timer1.Enabled:=true;
radiobutton1.Visible:=true;
radiobutton2.Visible:=true;
radiobutton3.Visible:=true;
radiobutton4.Visible:=true;
button2.Visible:=false;
button3.Visible:=true;
unit1.ConvToLev(vartest[i]);
case cicle of
1:sprvidp:=form1.RebuildTest(level,'sin');
2:sprvidp:=form1.RebuildTest(level,'cos');
3:sprvidp:=form1.RebuildTest(level,'tg');
4:sprvidp:=form1.RebuildTest(level,'');
5:sprvidp:=form1.RebuildTest(level,'');
end;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
button3.Visible:=false;
button4.Visible:=true;
radiobutton1.enabled:=false;
radiobutton2.enabled:=false;
radiobutton3.enabled:=false;
radiobutton4.enabled:=false;
if radiobutton1.Checked then vidp:=1;
if radiobutton2.Checked then vidp:=2;
if radiobutton3.Checked then vidp:=3;
if radiobutton4.Checked then vidp:=4;
Tradiobutton(form1.FindComponent('radiobutton'+inttostr(vidp))).Color:=clred;
writeln(f1,vidps[vidp]);
writeln(f1,'');
if vidp=sprvidp then begin
mark:=mark+(6/13);
if lang='ua' then
s5:='Вірно!'
else
if lang='en' then
s5:='True!'
else
if lang='ru' then
s5:='Верно!';
label2.Caption:=s5;

writeln(f1,'!!!OK!!!');
writeln(f1,'');
Tradiobutton(form1.FindComponent('radiobutton'+inttostr(vidp))).Color:=clgreen;
end
else
begin
if lang='ua' then
s5:='Помилка!'
else
if lang='en' then
s5:='Error!'
else
if lang='ru' then
s5:='Ошибка!';
label2.Caption:=s5;
writeln(f1,'!!!ERROR!!!');
writeln(f1,'');
end;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
image5.Hide;
Tradiobutton(form1.FindComponent('radiobutton'+inttostr(vidp))).Color:=clbtnface;
button4.Visible:=false;
button3.Visible:=true;
if (i=26)then
begin
timer1.Enabled:=false;
button3.Hide;
if mark=0 then mark:=1;
if lang='ua' then
s5:='Ваша оцінка :'
else
if lang='en' then
s5:='Your mark :'
else
if lang='ru' then
s5:='Ваша оценка :';
label2.Caption:=s5+inttostr(trunc(mark));
writeln(f1,'!!!'+label2.caption+'!!!');
if lang='ua' then
s5:='Пройшло часу : '
else
if lang='en' then
s5:='Time elapsed : '
else
if lang='ru' then
s5:='Прошло вемени : ';
label4.Caption:=s5+inttostr(trunc(tim))+'c';
writeln(f1,'!!!'+label4.caption+'!!!');
writeln(f1,'');
end
else begin
i:=i+1;
label3.Caption:=inttostr(i)+'/26';
unit1.ConvToLev(vartest[i]);

case cicle of
1:sprvidp:=form1.RebuildTest(level,'sin');
2:sprvidp:=form1.RebuildTest(level,'cos');
3:sprvidp:=form1.RebuildTest(level,'tg');
4:sprvidp:=form1.RebuildTest(level,'');
5:sprvidp:=form1.RebuildTest(level,'');
end;
label2.Caption:='';
radiobutton1.enabled:=true;
radiobutton2.enabled:=true;
radiobutton3.enabled:=true;
radiobutton4.enabled:=true;
end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
closefile(f1);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if tim=300 then begin
timer1.Enabled:=false;
image5.Hide;
image5.Canvas.Rectangle(image5.BoundsRect);
button4.Visible:=false;
button3.Hide;
if lang='ua' then
s5:='Ваша оцінка :'
else
if lang='en' then
s5:='Your mark :'
else
if lang='ru' then
s5:='Ваша оценка :';
label2.Caption:=s5+inttostr(trunc(mark));
writeln(f1,'!!!'+label2.caption+'!!!');
if lang='ua' then
s5:='Пройшло часу : '
else
if lang='en' then
s5:='Time elapsed : '
else
if lang='ru' then
s5:='Прошло вемени : ';
label4.Caption:=s5+inttostr(trunc(tim))+'c';
writeln(f1,'!!!'+label4.caption+'!!!');
writeln(f1,'');
end
else
begin
tim:=tim+1;
label5.Caption:=inttostr(trunc(tim))+'c/300c';
end;
end;

procedure TForm1.FormShow(Sender: TObject);
begin
if lang='ua' then
begin
s1:='Виберіть значення ';
button1.Caption:='Закрити';
button2.Caption:='Старт';
button3.Caption:='Перевірка';
button4.Caption:='Продовження';
end
else
if lang='en' then
begin
s1:='Select value for ';
button1.Caption:='Close';
button2.Caption:='Start';
button3.Caption:='Check';
button4.Caption:='Next';
end
else
if lang='ru' then
begin
s1:='Выберите значение ';
button1.Caption:='Закрить';
button2.Caption:='Старт';
button3.Caption:='Проверка';
button4.Caption:='Продолжить';
end;
if fileexists('statistic.txt')<>true then begin
assignfile(f1,'statistic.txt');
rewrite(f1);
end
else begin
assignfile(f1,'statistic.txt');
append(f1);
end;
writeln(f1,'Test');
end;

end.
