Kriptografik algoritmlarini o‘rganish uchun elektron qo‘llanama yaratish


Download 106.5 Kb.
Sana18.06.2023
Hajmi106.5 Kb.
#1568963
Bog'liq
Asrayev M №2


Deponentlanadigan materiallarning titul varag‘i
EHM uchun dastur (Ma’lumotlar bazasi) nomi:
“Kriptografik algoritmlarini o‘rganish uchun elektron qo‘llanama yaratish” nomli dasturiy ta’minot

Huquq ega(lar)si :


1. Muhammad al-Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti Farg’ona filiali
Muallif(lar):

  1. Asrayev Muhammadmullo Abdullajon o‘g‘li

  2. Kayumov Axror Muminjonovich

1. EHM uchun dasturni identifikatsiya qiluvchi materiallar dastlabki matni (Dastur kodi)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Image1: TImage;
Button3: TButton;
Bevel1: TBevel;
Bevel2: TBevel;
Bevel3: TBevel;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;


implementation

uses Unit2, Unit4, Unit6, Unit8, Unit9, Unit13, Unit14, Unit15, Unit16,


Unit21, Unit22, Unit23, Unit25, Unit29, Unit11, Unit31;

{$R *.dfm}


procedure TForm1.Button2Click(Sender: TObject);
begin
form29.show;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
form25.show;
end;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
i := GetWindowLong(Button1.Handle, GWL_STYLE);
SetWindowLong(Button1.Handle, GWL_STYLE, i or BS_MULTILINE);
i := GetWindowLong(Button2.Handle, GWL_STYLE);
SetWindowLong(Button2.Handle, GWL_STYLE, i or BS_MULTILINE);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
form31.show; close;
end;end.
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, ExtCtrls, StdCtrls;
type
TForm2 = class(TForm)
StringGrid1: TStringGrid;
StringGrid2: TStringGrid;
StringGrid3: TStringGrid;
Timer1: TTimer;
Bevel1: TBevel;
Label1: TLabel;
Timer2: TTimer;
Button1: TButton;
Timer3: TTimer;
Bevel2: TBevel;
Bevel3: TBevel;
Bevel4: TBevel;
Bevel5: TBevel;
StringGrid4: TStringGrid;
StringGrid5: TStringGrid;
StringGrid6: TStringGrid;
Timer4: TTimer;
StringGrid7: TStringGrid;
StringGrid8: TStringGrid;
Label2: TLabel;
Bevel6: TBevel;
Bevel7: TBevel;
Bevel8: TBevel;
Label3: TLabel;
Timer5: TTimer;
Timer6: TTimer;
Button2: TButton;
StringGrid9: TStringGrid;
StringGrid10: TStringGrid;
Bevel9: TBevel;
Bevel10: TBevel;
Bevel12: TBevel;
Timer7: TTimer;
Timer8: TTimer;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
StringGrid11: TStringGrid;
Button3: TButton;
Bevel13: TBevel;
Button4: TButton;
Timer9: TTimer;
Bevel14: TBevel;
StringGrid12: TStringGrid;
StringGrid13: TStringGrid;
StringGrid14: TStringGrid;
Bevel15: TBevel;
Bevel16: TBevel;
Bevel17: TBevel;
Label8: TLabel;
Timer10: TTimer;
Timer11: TTimer;
Button5: TButton;
Bevel18: TBevel;
Bevel19: TBevel;
Bevel20: TBevel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
StringGrid16: TStringGrid;
Timer12: TTimer;
Timer13: TTimer;
Timer14: TTimer;
Button6: TButton;
StringGrid15: TStringGrid;
Bevel22: TBevel;
Bevel23: TBevel;
Timer15: TTimer;
Bevel24: TBevel;
Bevel25: TBevel;
Bevel26: TBevel;
Bevel27: TBevel;
Bevel28: TBevel;
StringGrid17: TStringGrid;
StringGrid18: TStringGrid;
Label13: TLabel;
Panel1: TPanel;
Panel2: TPanel;
Label14: TLabel;
Label4: TLabel;
Label9: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
procedure StringGrid3DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Timer1Timer(Sender: TObject);
procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Timer2Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure newblock;
procedure newblock2;
procedure newblock3;
procedure newblock4;
procedure newblock5;
procedure FormCreate(Sender: TObject);
procedure Timer3Timer(Sender: TObject);
procedure Timer4Timer(Sender: TObject);
procedure Timer5Timer(Sender: TObject);
procedure StringGrid7DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Timer6Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure StringGrid6DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Timer8Timer(Sender: TObject);
procedure StringGrid9DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure StringGrid11DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Timer7Timer(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Timer9Timer(Sender: TObject);
procedure Timer11Timer(Sender: TObject);
procedure Timer10Timer(Sender: TObject);
procedure StringGrid13DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure StringGrid12DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Button5Click(Sender: TObject);
procedure Timer12Timer(Sender: TObject);
procedure Timer14Timer(Sender: TObject);
procedure Timer13Timer(Sender: TObject);
procedure StringGrid14DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Button6Click(Sender: TObject);
procedure StringGrid15DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure Timer15Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
f1,f2:text;
q,w,ii,jj,ii1,jj1:integer;
implementation

uses Unit3, Unit4, Unit5;


{$R *.dfm}
procedure TForm2.newblock;
label 11;
var n1,n2:integer;
begin
11: inc(ii);
if ii=16 then begin inc(jj); ii:=0; end;
if jj>3 then begin
stringgrid1.font.Color:=clsilver;
timer2.Enabled:=false;
exit
end
else begin
n1:=strtoint(stringgrid3.cells[ii,jj]) mod 8 - 1;
if n1<0 then n1:=7;
n2:=strtoint(stringgrid3.cells[ii,jj]) div 8;
if strtoint(stringgrid3.cells[ii,jj]) mod 8=0 then n2:=n2-1;
end;
stringgrid2.Cells[q,w]:=stringgrid1.Cells[n1,n2];
stringgrid4.Cells[q,w]:=stringgrid1.Cells[n1,n2];
if w<4 then begin
stringgrid5.Cells[q,w]:=stringgrid1.Cells[n1,n2];
stringgrid15.Cells[q,w]:=stringgrid1.Cells[n1,n2];
end
else begin
stringgrid6.Cells[q,w-4]:=stringgrid1.Cells[n1,n2];
stringgrid17.Cells[q,w-4]:=stringgrid6.Cells[q,w-4];
end;
inc(q);
if q=8 then begin inc(w); q:=0; end;
goto 11;
end;
procedure TForm2.Timer1Timer(Sender: TObject);
var n1,n2:integer;
begin
inc(ii);
if ii=16 then begin inc(jj); ii:=0; end;
if jj>3 then begin
timer1.Enabled:=false;
timer2.Enabled:=false;
stringgrid1.font.Color:=clsilver;
label1.Visible:=false;
end
else begin
stringgrid3.Col:=ii;
stringgrid3.Row:=jj;
n1:=strtoint(stringgrid3.cells[ii,jj]) mod 8 - 1;
if n1<0 then stringgrid1.Col:=7 else stringgrid1.Col:=n1;
n2:=strtoint(stringgrid3.cells[ii,jj]) div 8;
if strtoint(stringgrid3.cells[ii,jj]) mod 8=0
then stringgrid1.Row:=n2-1
else stringgrid1.Row:=n2;
end;
label1.Left:=bevel1.Left+8;
end;

procedure TForm2.StringGrid3DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=ii) and (arow=jj) then
begin
stringgrid3.Canvas.Brush.color:=clsilver;
stringgrid3.Canvas.Font.Color:=clblack;
stringgrid3.Canvas.FillRect(rect);
stringgrid3.Canvas.TextOut(rect.Left,rect.top,
stringgrid3.Cells[aCol, aRow]);
end;
end;

procedure TForm2.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=stringgrid1.col) and (arow=stringgrid1.Row) then
begin
stringgrid1.Canvas.Brush.color:=claqua;
stringgrid1.Canvas.Font.Color:=clblack;
stringgrid1.Canvas.FillRect(rect);
stringgrid1.Canvas.TextOut(rect.Left,rect.top,
stringgrid1.Cells[aCol, aRow]);
label1.Caption:=stringgrid1.Cells[aCol, aRow];
stringgrid2.Cells[q,w]:=stringgrid1.Cells[acol,arow];
stringgrid4.Cells[q,w]:=stringgrid1.Cells[acol,arow];
if w<4 then begin
stringgrid5.Cells[q,w]:=stringgrid1.Cells[acol,arow];
stringgrid15.Cells[q,w]:=stringgrid1.Cells[acol,arow];
end
else begin
stringgrid6.Cells[q,w-4]:=stringgrid1.Cells[acol,arow];
stringgrid17.Cells[q,w-4]:=stringgrid6.Cells[q,w-4];
end;
inc(q);
if q=8 then begin inc(w); q:=0; end;
end;
end;

procedure TForm2.Timer2Timer(Sender: TObject);


begin
label1.visible:=false;
label1.Left:=label1.Left+25;
label1.visible:=true;
end;

procedure TForm2.FormShow(Sender: TObject);


begin
label1.visible:=true;
q:=0; w:=0;
ii:=0; jj:=0;
ii1:=0; jj1:=0;
timer1.Enabled:=true;
timer2.Enabled:=true;
stringgrid1.font.Color:=clblack;
end;

procedure TForm2.Button1Click(Sender: TObject);


begin
label1.Visible:=false;
timer1.Enabled:=false;
timer2.Enabled:=false;
newblock;
bevel2.Visible:=true; bevel3.Visible:=true;
bevel4.Visible:=true; bevel5.Visible:=true;
form2.Timer3.Enabled:=true;
button1.Enabled:=false;
label17.Visible:=true;
label18.Visible:=true;
end;

procedure TForm2.FormCreate(Sender: TObject);


var i,j,x: integer;
begin
assignfile(f1, 'DES/kirish.txt'); reset(f1);
for i:=0 to 7 do
for j:=0 to 7 do begin read(f1,x); stringgrid1.Cells[j,i]:=inttostr(x); end;
closefile(f1);
assignfile(f1, 'DES/bosh.txt'); reset(f1);
for i:=0 to 3 do
for j:=0 to 15 do begin read(f1,x); stringgrid3.Cells[j,i]:=inttostr(x); end;
closefile(f1);
assignfile(f1, 'DES/perestanovka.txt'); reset(f1);
for i:=0 to 3 do
for j:=0 to 11 do begin read(f1,x); stringgrid7.Cells[j,i]:=inttostr(x); end;
closefile(f1);
assignfile(f1, 'DES/P-bloklar.txt'); reset(f1);
for i:=0 to 3 do
for j:=0 to 7 do begin read(f1,x); stringgrid13.Cells[j,i]:=inttostr(x); end;
closefile(f1);
scrollinview(stringgrid1);
end;

procedure TForm2.Timer3Timer(Sender: TObject);


begin
if stringgrid4.topbegin
stringgrid4.Visible:=false;
stringgrid4.Left:=stringgrid4.Left-15;
stringgrid4.top:=stringgrid4.top+15;
stringgrid4.Visible:=true;
end
else if stringgrid4.Left>stringgrid5.left then
begin
stringgrid4.Visible:=false;
stringgrid4.Left:=stringgrid4.Left-15;
stringgrid4.Visible:=true;
end
else begin
form2.Timer3.Enabled:=false;
label22.Visible:=false;
stringgrid4.Visible:=false;
stringgrid5.Visible:=true;
stringgrid6.Visible:=true;
timer4.Enabled:=true;
end;
end;

procedure TForm2.Timer4Timer(Sender: TObject);


begin
if stringgrid5.Left>stringgrid1.left then
begin
stringgrid5.Visible:=false;
stringgrid5.Left:=stringgrid5.Left-10;
stringgrid5.Visible:=true;
stringgrid6.Visible:=false;
stringgrid6.Left:=stringgrid6.Left+10;
stringgrid6.Visible:=true;
end
else if stringgrid6.Leftbegin
stringgrid6.Visible:=false;
stringgrid6.Left:=stringgrid6.Left+10;
stringgrid6.Visible:=true;
end
else if stringgrid6.top>stringgrid5.top then
begin
stringgrid6.Visible:=false;
stringgrid6.top:=stringgrid6.top-10;
stringgrid6.Visible:=true;
end
else begin
bevel6.visible:=true; bevel7.visible:=true; bevel8.visible:=true;
stringgrid7.Visible:=true;
stringgrid8.Visible:=true;
timer4.Enabled:=false;
ii:=-1;jj:=0;q:=0;w:=0;
timer5.Enabled:=true;
timer6.Enabled:=true;
label22.Visible:=true;
button2.Visible:=true;
scrollinview(panel1);
end;
end;

procedure TForm2.Timer5Timer(Sender: TObject);


var n1,n2:integer;
begin
inc(ii);
if ii=12 then begin inc(jj); ii:=0; end;
if jj>3 then begin
timer5.Enabled:=false;
timer6.Enabled:=false;
stringgrid6.font.Color:=clsilver;
label3.Visible:=false;
end
else begin
stringgrid7.Col:=ii;
stringgrid7.Row:=jj;
n1:=strtoint(stringgrid7.cells[ii,jj]) mod 8 - 1;
if n1<0 then stringgrid6.Col:=7 else stringgrid6.Col:=n1;
n2:=strtoint(stringgrid7.cells[ii,jj]) div 8;
if strtoint(stringgrid7.cells[ii,jj]) mod 8=0
then stringgrid6.Row:=n2-1
else stringgrid6.Row:=n2;
end;
label3.top:=bevel6.Top+6;
end;

procedure TForm2.StringGrid7DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=ii) and (arow=jj) then
begin
stringgrid7.Canvas.Brush.color:=clsilver;
stringgrid7.Canvas.Font.Color:=clblack;
stringgrid7.Canvas.FillRect(rect);
stringgrid7.Canvas.TextOut(rect.Left,rect.top,
stringgrid7.Cells[aCol, aRow]);
end;
end;

procedure TForm2.Timer6Timer(Sender: TObject);


begin
label3.visible:=false;
label3.top:=label3.top+13;
label3.visible:=true;
end;

procedure TForm2.newblock2;


label 11;
var n1,n2:integer;
begin
11: inc(ii);
if ii=12 then begin inc(jj); ii:=0; end;
if jj>3 then begin
stringgrid6.font.Color:=clsilver;
exit
end
else begin
n1:=strtoint(stringgrid7.cells[ii,jj]) mod 8 - 1;
if n1<0 then n1:=7;
n2:=strtoint(stringgrid7.cells[ii,jj]) div 8;
if strtoint(stringgrid7.cells[ii,jj]) mod 8=0 then n2:=n2-1;
end;
stringgrid8.Cells[q,w]:=stringgrid6.Cells[n1,n2];
stringgrid11.Cells[q,w]:=stringgrid6.Cells[n1,n2];
inc(q);
if q=12 then begin inc(w); q:=0; end;
goto 11;
end;

procedure TForm2.Button2Click(Sender: TObject);


begin
label3.Visible:=false;
label21.Visible:=true;
timer5.Enabled:=false;
timer6.Enabled:=false;
newblock2;
stringgrid9.Visible:=true;
stringgrid10.Visible:=true;
stringgrid8.Visible:=false;
stringgrid11.Visible:=true;
ii:=0;jj:=0;q:=0;w:=0;
timer7.Enabled:=true;
timer8.Enabled:=true;
bevel9.Visible:=true;
bevel10.Visible:=true;
panel1.Visible:=true;
bevel12.Visible:=true;
scrollinview(button4);
button2.Enabled:=false;
button3.Visible:=true;
end;

procedure TForm2.StringGrid6DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=stringgrid6.col) and (arow=stringgrid6.Row) then
begin
stringgrid6.Canvas.Brush.color:=claqua;
stringgrid6.Canvas.Font.Color:=clblack;
stringgrid6.Canvas.FillRect(rect);
stringgrid6.Canvas.TextOut(rect.Left,rect.top,
stringgrid6.Cells[aCol, aRow]);
label3.Caption:=stringgrid6.Cells[aCol, aRow];
stringgrid8.Cells[q,w]:=stringgrid6.Cells[acol,arow];
stringgrid11.Cells[q,w]:=stringgrid6.Cells[acol,arow];
inc(q);
if q=12 then begin inc(w); q:=0; end;
end;
end;

procedure TForm2.Timer8Timer(Sender: TObject);


begin
label5.visible:=false;
label5.left:=label5.left+10;
label5.visible:=true;
label6.visible:=false;
label6.top:=label6.top+5;
label6.visible:=true;
label7.visible:=false;
label7.top:=label7.top+5;
label7.visible:=true;
end;

procedure TForm2.StringGrid9DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=stringgrid9.col) and (arow=stringgrid9.Row) then
begin
stringgrid9.Canvas.Brush.color:=claqua;
stringgrid9.Canvas.Font.Color:=clblack;
stringgrid9.Canvas.FillRect(rect);
stringgrid9.Canvas.TextOut(rect.Left,rect.top,
stringgrid9.Cells[aCol, aRow]);
label5.Caption:=stringgrid9.Cells[aCol, aRow];
stringgrid10.Cells[ii,jj]:=inttostr(strtoint(stringgrid9.Cells[acol,arow]) xor strtoint(stringgrid11.Cells[acol,arow]));
label7.Caption:=stringgrid10.Cells[ii,jj];
end;
end;

procedure TForm2.StringGrid11DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=stringgrid11.col) and (arow=stringgrid11.Row) then
begin
stringgrid11.Canvas.Brush.color:=claqua;
stringgrid11.Canvas.Font.Color:=clblack;
stringgrid11.Canvas.FillRect(rect);
stringgrid11.Canvas.TextOut(rect.Left,rect.top,
stringgrid11.Cells[aCol, aRow]);
label6.Caption:=stringgrid11.Cells[aCol, aRow];
end;
end;

procedure TForm2.Timer7Timer(Sender: TObject);


begin
inc(ii); if ii=12 then begin inc(jj); ii:=0; end;
if jj>3 then begin
timer7.Enabled:=false;
timer8.Enabled:=false;
stringgrid11.font.Color:=clsilver;
label5.Visible:=false;
label6.Visible:=false;
label7.Visible:=false;
button4.Visible:=true;
timer9.Enabled:=true;
button3.Enabled:=false;
exit;
end
else begin
stringgrid9.Col:=ii; stringgrid11.Col:=ii;
stringgrid9.Row:=jj; stringgrid11.Row:=jj;
end;
label5.left:=bevel10.left+6;
label6.top:=bevel9.top+11;
label7.top:=bevel12.top+2;
end;

procedure TForm2.Button3Click(Sender: TObject);


begin
label5.Visible:=false;
label6.Visible:=false;
label7.Visible:=false;
timer7.Enabled:=false;
timer8.Enabled:=false;
newblock3;
ii:=0;jj:=0;q:=0;w:=0;
bevel13.Visible:=true;
button4.Visible:=true;
timer9.Enabled:=true;
scrollinview(stringgrid12);
button3.Enabled:=false;
end;

procedure TForm2.newblock3;


label 11;
begin
11: inc(ii);
if ii=12 then begin inc(jj); ii:=0; end;
if jj>3 then begin
stringgrid11.font.Color:=clsilver;
exit;
end;
stringgrid10.Cells[ii,jj]:=inttostr(strtoint(stringgrid9.Cells[ii,jj]) xor strtoint(stringgrid11.Cells[ii,jj]));
goto 11;
end;

procedure TForm2.Button4Click(Sender: TObject);


var i,j:integer;
begin
timer9.Enabled:=false;
q:=0;w:=0;
for i:=0 to 7 do for j:=0 to 5 do
begin
form5.StringGrid9.Cells[j,i]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end;
end;
q:=0;w:=0;
for i:=0 to 5 do
begin form5.StringGrid10.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
for i:=0 to 5 do
begin form5.StringGrid11.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
for i:=0 to 5 do
begin form5.StringGrid12.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
for i:=0 to 5 do
begin form5.StringGrid13.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
for i:=0 to 5 do
begin form5.StringGrid14.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
for i:=0 to 5 do
begin form5.StringGrid15.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
for i:=0 to 5 do
begin form5.StringGrid16.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
for i:=0 to 5 do
begin form5.StringGrid17.Cells[i,0]:=stringgrid10.Cells[q,w];
inc(q); if q=12 then begin q:=0; inc(w); end end;
q:=0;w:=0;ii:=0;jj:=0;
form5.show;
end;

procedure TForm2.Timer9Timer(Sender: TObject);


begin
button4.Font.Color:=clRed;
end;

procedure TForm2.Timer11Timer(Sender: TObject);


begin
label8.visible:=false;
label8.top:=label8.top+10;
label8.visible:=true;
end;

procedure TForm2.Timer10Timer(Sender: TObject);


var n1,n2:integer;
begin
inc(ii);
if ii=8 then begin inc(jj); ii:=0; end;
if jj>3 then begin
timer10.Enabled:=false;
timer11.Enabled:=false;
stringgrid12.font.Color:=clsilver;
label8.Visible:=false;
end
else begin
stringgrid13.Col:=ii;
stringgrid13.Row:=jj;
n1:=strtoint(stringgrid13.cells[ii,jj]) mod 8 - 1;
if n1<0 then stringgrid12.Col:=7 else stringgrid12.Col:=n1;
n2:=strtoint(stringgrid13.cells[ii,jj]) div 8;
if strtoint(stringgrid13.cells[ii,jj]) mod 8=0
then stringgrid12.Row:=n2-1
else stringgrid12.Row:=n2;
end;
label8.top:=bevel16.top+4;
end;

procedure TForm2.StringGrid13DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=ii) and (arow=jj) then
begin
stringgrid13.Canvas.Brush.color:=clsilver;
stringgrid13.Canvas.Font.Color:=clblack;
stringgrid13.Canvas.FillRect(rect);
stringgrid13.Canvas.TextOut(rect.Left,rect.top,
stringgrid13.Cells[aCol, aRow]);
end;
end;

procedure TForm2.StringGrid12DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=stringgrid12.col) and (arow=stringgrid12.Row) then
begin
stringgrid12.Canvas.Brush.color:=claqua;
stringgrid12.Canvas.Font.Color:=clblack;
stringgrid12.Canvas.FillRect(rect);
stringgrid12.Canvas.TextOut(rect.Left,rect.top,
stringgrid12.Cells[aCol, aRow]);
label8.Caption:=stringgrid12.Cells[aCol, aRow];
stringgrid14.Cells[q,w]:=stringgrid12.Cells[acol,arow];
inc(q);
if q=8 then begin inc(w); q:=0; end;
end;
end;

procedure TForm2.Button5Click(Sender: TObject);


begin
label8.Visible:=false;
timer10.Enabled:=false;
timer11.Enabled:=false;
newblock4;
bevel18.Visible:=true; bevel19.Visible:=true;
bevel20.Visible:=true;
panel2.Visible:=true;
stringgrid15.Visible:=true;
stringgrid16.Visible:=true;
scrollinview(stringgrid15);
bevel22.Visible:=true;
timer12.Enabled:=true;
button6.Visible:=true;
button5.Enabled:=false;
end;

procedure TForm2.newblock4;


label 11;
var n1,n2:integer;
begin
11: inc(ii);
if ii=8 then begin inc(jj); ii:=0; end;
if jj>3 then begin
stringgrid12.font.Color:=clsilver;
timer10.Enabled:=false;
timer11.Enabled:=false;
exit
end
else begin
n1:=strtoint(stringgrid13.cells[ii,jj]) mod 8 - 1;
if n1<0 then n1:=7;
n2:=strtoint(stringgrid13.cells[ii,jj]) div 8;
if strtoint(stringgrid13.cells[ii,jj]) mod 8=0 then n2:=n2-1;
end;
stringgrid14.Cells[q,w]:=stringgrid12.Cells[n1,n2];
inc(q);
if q=8 then begin inc(w); q:=0; end;
goto 11;
end;

procedure TForm2.Timer12Timer(Sender: TObject);


begin
if stringgrid15.Topbegin
stringgrid15.Visible:=false;
stringgrid15.Top:=stringgrid15.Top+20;
stringgrid15.Visible:=true;
scrollinview(stringgrid15);
bevel22.Height:=bevel22.Height+18;
end
else if stringgrid15.Leftbegin
bevel23.Visible:=true;
stringgrid15.Visible:=false;
stringgrid15.left:=stringgrid15.left+15;
stringgrid15.Visible:=true;
bevel23.Width:=bevel23.Width+15
end
else begin
timer12.Enabled:=false;
timer13.Enabled:=true;
timer14.Enabled:=true;
scrollinview(label2);
end;
end;

procedure TForm2.Timer14Timer(Sender: TObject);


begin
label10.visible:=false;
label10.left:=label10.left+10;
label10.visible:=true;
label11.visible:=false;
label11.top:=label11.top+5;
label11.visible:=true;
label12.visible:=false;
label12.top:=label12.top+5;
label12.visible:=true;
end;

procedure TForm2.Timer13Timer(Sender: TObject);


begin
inc(ii1); if ii1=8 then begin inc(jj1); ii1:=0; end;
if jj1>3 then begin
timer13.Enabled:=false;
timer14.Enabled:=false;
stringgrid14.font.Color:=clsilver;
label10.Visible:=false;
label11.Visible:=false;
label12.Visible:=false;
bevel24.Visible:=true;
timer15.Enabled:=true;
scrollinview(stringgrid6);
exit;
end
else begin
stringgrid15.Col:=ii1; stringgrid14.Col:=ii1;
stringgrid15.Row:=jj1; stringgrid14.Row:=jj1;
end;
label10.left:=bevel19.left+6;
label11.top:=bevel18.top+11;
label12.top:=bevel20.top+2;
end;

procedure TForm2.StringGrid14DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=stringgrid14.col) and (arow=stringgrid14.Row) then
begin
stringgrid14.Canvas.Brush.color:=claqua;
stringgrid14.Canvas.Font.Color:=clblack;
stringgrid14.Canvas.FillRect(rect);
stringgrid14.Canvas.TextOut(rect.Left,rect.top,
stringgrid14.Cells[aCol, aRow]);
label11.Caption:=stringgrid14.Cells[aCol, aRow];
end;
end;

procedure TForm2.StringGrid15DrawCell(Sender: TObject; ACol, ARow: Integer;


Rect: TRect; State: TGridDrawState);
begin
if (aCol=stringgrid15.col) and (arow=stringgrid15.Row) then
begin
stringgrid15.Canvas.Brush.color:=claqua;
stringgrid15.Canvas.Font.Color:=clblack;
stringgrid15.Canvas.FillRect(rect);
stringgrid15.Canvas.TextOut(rect.Left,rect.top,
stringgrid15.Cells[aCol, aRow]);
label10.Caption:=stringgrid15.Cells[aCol, aRow];
stringgrid16.Cells[ii1,jj1]:=inttostr(strtoint(stringgrid15.Cells[acol,arow]) xor strtoint(stringgrid14.Cells[acol,arow]));
stringgrid18.Cells[ii1,jj1]:=stringgrid16.Cells[ii1,jj1];
label12.Caption:=stringgrid16.Cells[ii1,jj1];
end;
end;

procedure TForm2.Button6Click(Sender: TObject);


begin
label10.Visible:=false;
label11.Visible:=false;
label12.Visible:=false;
timer13.Enabled:=false;
timer14.Enabled:=false;
newblock5;
scrollinview(stringgrid6);
bevel24.Visible:=true;
timer15.Enabled:=true;
button6.Enabled:=false;
end;

procedure TForm2.newblock5;


label 11;
begin
11: inc(ii1);
if ii1=8 then begin inc(jj1); ii1:=0; end;
if jj1>3 then begin
stringgrid14.font.Color:=clsilver;
exit;
end;
stringgrid16.Cells[ii1,jj1]:=inttostr(strtoint(stringgrid15.Cells[ii1,jj1]) xor strtoint(stringgrid14.Cells[ii1,jj1]));
stringgrid18.Cells[ii1,jj1]:=stringgrid16.Cells[ii1,jj1];
goto 11;
end;

procedure TForm2.Timer15Timer(Sender: TObject);


begin
if bevel25.left>bevel26.Left then begin
bevel25.Visible:=true;
bevel25.Left:=bevel25.Left-9;
bevel25.width:=bevel25.width+9;
scrollinview(bevel25);
end
else if bevel26.topbegin
bevel26.Visible:=true;
bevel26.Top:=bevel26.Top+10;
bevel26.height:=bevel26.Height-11;
scrollinview(bevel26);
end
else if bevel27.left>bevel28.Left then
begin
bevel27.Visible:=true;
bevel27.left:=bevel27.left-5;
bevel27.width:=bevel27.width+5;
scrollinview(bevel27);
end
else if bevel28.topbegin
bevel28.Visible:=true;
bevel28.Top:=bevel28.Top+10;
label13.Visible:=false;
label13.Top:=label13.Top+10;
label13.Visible:=true;
bevel28.Height:=bevel28.Height-10;
scrollinview(label13);
end
else begin
timer15.Enabled:=false;
stringgrid17.Visible:=true;
stringgrid18.Visible:=true;
scrollinview(label2);
label4.Visible:=true;
label9.Visible:=true;
label15.Visible:=true;
label16.Visible:=true;
end;
end;
end.


Download 106.5 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling