TAMPILAN PROGRAM
Script Code :
unit berhasil;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls, Buttons;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
B: TButton;
C: TButton;
D: TButton;
E: TButton;
F: TButton;
G: TButton;
II: TButton;
JJ: TButton;
K: TButton;
L: TButton;
M: TButton;
N: TButton;
P: TButton;
Q: TButton;
R: TButton;
S: TButton;
U: TButton;
V: TButton;
W: TButton;
X: TButton;
Z: TButton;
Nol: TButton;
Dua: TButton;
Tiga: TButton;
Lima: TButton;
Enam: TButton;
Tujuh: TButton;
Delapan: TButton;
Sembilan: TButton;
Min: TButton;
Pembagian: TButton;
Perkalian: TButton;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
Clear: TButton;
GroupBox5: TGroupBox;
T: TButton;
H: TButton;
O: TButton;
Y: TButton;
Plus: TButton;
satu: TButton;
Empat: TButton;
Label1: TLabel;
GroupBox3: TGroupBox;
Button2: TButton;
BitBtn1: TBitBtn;
A: TButton;
procedure AClick(Sender: TObject);
procedure TClick(Sender: TObject);
procedure BClick(Sender: TObject);
procedure ClearClick(Sender: TObject);
procedure CClick(Sender: TObject);
procedure DClick(Sender: TObject);
procedure EClick(Sender: TObject);
procedure FClick(Sender: TObject);
procedure GClick(Sender: TObject);
procedure HClick(Sender: TObject);
procedure IIClick(Sender: TObject);
procedure JJClick(Sender: TObject);
procedure KClick(Sender: TObject);
procedure LClick(Sender: TObject);
procedure MClick(Sender: TObject);
procedure NClick(Sender: TObject);
procedure OClick(Sender: TObject);
procedure PClick(Sender: TObject);
procedure QClick(Sender: TObject);
procedure RClick(Sender: TObject);
procedure SClick(Sender: TObject);
procedure UClick(Sender: TObject);
procedure VClick(Sender: TObject);
procedure WClick(Sender: TObject);
procedure XClick(Sender: TObject);
procedure YClick(Sender: TObject);
procedure ZClick(Sender: TObject);
procedure PlusClick(Sender: TObject);
procedure MinClick(Sender: TObject);
procedure PembagianClick(Sender: TObject);
procedure PerkalianClick(Sender: TObject);
procedure NolClick(Sender: TObject);
procedure satuClick(Sender: TObject);
procedure DuaClick(Sender: TObject);
procedure TigaClick(Sender: TObject);
procedure EmpatClick(Sender: TObject);
procedure LimaClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure EnamClick(Sender: TObject);
procedure TujuhClick(Sender: TObject);
procedure DelapanClick(Sender: TObject);
procedure SembilanClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i,j:integer;
implementation
{$R *.dfm}
procedure TForm1.AClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or (j=1) or (j=5) or (i=3) then
StringGrid1.Cells[j,i]:=('A');
end;
end;
end;
procedure TForm1.TClick(Sender: TObject);
begin
ClearClick(self);
for i:=1 to stringGrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or (j=3) then
StringGrid1.Cells[j,i]:=('T');
end;
end;
end;
procedure TForm1.BClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringGrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and(j=4) or (i=2) and (j=5) or
(i=3) and (j=1) or (i=3) and (j=2) or (i=3) and (j=3) or (i=3) and (j=4) or
(j=1) or (i=4) and (j=5) or (i=5) and (j=2) or (i=5) and (j=3) or (i=5) and
(j=4) then stringgrid1.Cells[j,i]:='B';
end;
end;
end;
procedure TForm1.ClearClick(Sender: TObject);
begin
for i:=1 to StringGrid1.ColCount-1 do
begin
for j:=1 to StringGrid1.RowCount-1 do
begin
StringGrid1.Cells[i,j]:=(' ');
end;
end;
end;
procedure TForm1.CClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and (j=4) or (i=1) and (j=5) or
(i=2) and (j=1) or (i=3) and (j=1) or (i=4) and (j=1) or
(i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (j=4) or (i=5) and (j=5)
then stringgrid1.Cells[j,i]:='C';
end;
end;
end;
procedure TForm1.DClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=1) or (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and (j=4) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) and (j=1) or (i=3) and (j=5) or
(i=4) and (j=1) or (i=4) and (j=5) or
(i=5) and (j=1) or (i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (j=4) then
stringgrid1.Cells[j,i]:='D';
end;
end;
end;
procedure TForm1.EClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or (i=3) or (i=5) or
(j=1) then stringgrid1.Cells[j,i]:=('E');
end;
end;
end;
procedure TForm1.FClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or (i=3) or
(j=1) then stringgrid1.Cells[j,i]:='F';
end;
end;
end;
procedure TForm1.GClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and (j=4) or (i=1) and (j=5) or
(i=2) and (j=1) or
(i=3) and (j=1) or (i=3) and (j=4) or (i=3) and (j=5) or
(i=4) and (j=1) or (i=4) and (j=5) or
(i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (j=4) or (i=5) and (j=5) then
stringgrid1.Cells[j,i]:='G';
end;
end;
end;
procedure TForm1.HClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=3) or
(j=1) or (j=5) then stringgrid1.Cells[j,i]:='H';
end;
end;
end;
procedure TForm1.IIClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=3) then stringgrid1.Cells[j,i]:='I';
end;
end;
end;
procedure TForm1.JJClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=4) or
(i=4) and (j=1) or
(i=5) and (j=2) or (i=5) and (j=3) then
stringgrid1.Cells[j,i]:='J';
end;
end;
end;
procedure TForm1.KClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=4) or
(i=2) and (j=3) or
(i=3) and (j=2) or
(i=4) and (j=3) or
(i=5) and (j=4) or
(j=1) then stringgrid1.Cells[j,i]:='K';
end;
end;
end;
procedure TForm1.LClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=1) or (i=5) then stringgrid1.Cells[j,i]:='L';
end;
end;
end;
procedure TForm1.MClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=1) or (j=5) or
(i=2) and (j=2) or (i=2) and (j=4) or
(i=3) and (j=3) then stringgrid1.Cells[j,i]:='M';
end;
end;
end;
procedure TForm1.NClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=1) or (j=5) or
(i=2) and (j=2) or
(i=3) and (j=3) or
(i=4) and (j=4) then stringgrid1.Cells[j,i]:='N';
end;
end;
end;
procedure TForm1.OClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and (j=4) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) and (j=1) or (i=3) and (j=5) or
(i=4) and (j=1) or (i=4) and (j=5) or
(i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (j=4) then
stringgrid1.Cells[j,i]:='O';
end;
end;
end;
procedure TForm1.PClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=2) or
(i=1) and (j=3) or (i=1) and (j=4) or
(i=2) and (j=5) or
(i=3) and (j=3) or (i=3) and (j=4) then stringgrid1.Cells[j,i]:='Q';
end;
end;
end;
procedure TForm1.QClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and (j=4) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) and (j=1) or (i=3) and (j=3) or (i=3) and (j=5) or
(i=4) and (j=1) or (i=4) and (j=4) or
(i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (j=5) then
stringgrid1.Cells[j,i]:='Q';
end;
end;
end;
procedure TForm1.RClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=2) or
(i=1) and (j=3) or (i=1) and (j=4) or
(i=2) and (j=5) or
(i=3) and (j=3) or (i=3) and (j=4) or
(i=4) and (j=4) or
(i=5) and (j=5) then stringgrid1.Cells[j,i]:='R';
end;
end;
end;
procedure TForm1.SClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or
(i=2) and (j=1) or
(i=3) or
(i=4) and (j=5) or
(i=5) then stringgrid1.Cells[j,i]:='S';
end;
end;
end;
procedure TForm1.UClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=1) or (i=1) and (j=5) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) and (j=1) or (i=3) and (j=5) or
(i=4) and (j=1) or (i=4) and (j=5) or
(i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (j=4) then
stringgrid1.Cells[j,i]:='U';
end;
end;
end;
procedure TForm1.VClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=1) or (i=1) and (j=5) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) and (j=1) or (i=3) and (j=5) or
(i=4) and (j=2) or (i=4) and (j=4) or
(i=5) and (j=3) then stringgrid1.Cells[j,i]:='V';
end;
end;
end;
procedure TForm1.WClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=1) or (j=5) or
(i=3) and (j=3) or
(i=4) and (j=2) or (i=4) and (j=4) then stringgrid1.Cells[j,i]:='W';
end;
end;
end;
procedure TForm1.XClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=1) or (i=1) and (j=5) or
(i=2) and (j=2) or (i=2) and (j=4) or
(i=3) and (j=3) or
(i=4) and (j=2) or (i=4) and (j=4) or
(i=5) and (j=1) or (i=5) and (j=5) then stringgrid1.Cells[j,i]:='X';
end;
end;
end;
procedure TForm1.YClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=1) or (i=1) and (j=5) or
(i=2) and (j=2) or (i=2) and (j=4) or
(i=3) and (j=3) or
(i=4) and (j=3) or
(i=5) and (j=3) then stringgrid1.Cells[j,i]:='Y';
end;
end;
end;
procedure TForm1.ZClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or (i=5) or
(i=2) and (j=4) or
(i=3) and (j=3) or
(i=4) and (j=2) then stringgrid1.Cells[j,i]:='Z';
end;
end;
end;
procedure TForm1.PlusClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.colcount-1 do
begin
for j:=1 to stringgrid1.rowcount-1 do
begin
if (i=3) or (j=3) then stringgrid1.Cells[j,i]:='+';
end;
end;
end;
procedure TForm1.MinClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=3) then stringgrid1.Cells[j,i]:='-';
end;
end;
end;
procedure TForm1.PembagianClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=5) or
(i=2) and (j=4) or
(i=3) and (j=3) or
(i=4) and (j=2) or
(i=5) and (j=1) then stringgrid1.Cells[j,i]:='/';
end;
end;
end;
procedure TForm1.PerkalianClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=1) or (i=1) and (j=5) or
(i=2) and (j=2) or (i=2) and (j=4) or
(i=3) or
(j=3) or
(i=3) and (j=3) or
(i=4) and (j=2) or (i=4) and (j=4) or
(i=5) and (j=1) or (i=5) and (j=5) then stringgrid1.Cells[j,i]:='*';
end;
end;
end;
procedure TForm1.NolClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and (j=4) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) and (j=1) or (i=3) and (j=5) or
(i=4) and (j=1) or (i=4) and (j=5) or
(i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (j=4) then
stringgrid1.Cells[j,i]:='0';
end;
end;
end;
procedure TForm1.satuClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (j=3) or
(i=2) and (j=2) or
(i=5) and (j=2) or (i=5) and (j=4) then
stringgrid1.Cells[j,i]:='1';
end;
end;
end;
procedure TForm1.DuaClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or
(i=2) and (j=5) or
(i=3) or
(i=4) and (j=1) or
(i=5) then stringgrid1.Cells[j,i]:='2';
end;
end;
end;
procedure TForm1.TigaClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or
(i=3) and (j=2) or (i=3) and (j=3) or (i=3) and (j=4) or
(i=5) or
(j=5) then stringgrid1.Cells[j,i]:='3';
end;
end;
end;
procedure TForm1.EmpatClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=3) or
(i=2) and (j=2) or
(i=3) or (j=4) then stringgrid1.Cells[j,i]:='4';
end;
end;
end;
procedure TForm1.LimaClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or
(i=2) and (j=1) or
(i=3) or
(i=4) and (j=5) or
(i=5) then stringgrid1.Cells[j,i]:='5';
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
showmessage('1. RIFQI ALFIYAN HIDAYAT (111010160)');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
showmessage('111010160');
end;
procedure TForm1.EnamClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or
(i=3) or
(i=4) and (j=5) or
(i=5) or
(j=1) then stringgrid1.Cells[j,i]:='6';
end;
end;
end;
procedure TForm1.TujuhClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) or
(i=2) and (j=4) or
(i=3) and (j=3) or
(i=4) and (j=3) or
(i=5) and (j=3) then stringgrid1.Cells[j,i]:='7';
end;
end;
end;
procedure TForm1.DelapanClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringGrid1.ColCount-1 do
begin
for j:=1 to stringgrid1.RowCount-1 do
begin
if (i=1) and (j=2) or (i=1) and (j=2) or (i=1) and (j=3) or (i=1) and (j=4) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) and (j=2) or (i=3) and (j=2) or (i=3) and (j=3) or (i=3) and (j=4) or
(i=4) and (j=1) or (i=4) and (j=5) or
(i=5) and (j=2) or (i=5) and (j=3) or (i=5) and (i=4) or (i=5) and (j=4) then
stringgrid1.Cells[j,i]:='8';
end;
end;
end;
procedure TForm1.SembilanClick(Sender: TObject);
begin
ClearClick(Self);
for i:=1 to stringgrid1.ColCount do
begin
for j:=1 to stringgrid1.RowCount do
begin
if (i=1) or
(i=2) and (j=1) or (i=2) and (j=5) or
(i=3) or
(i=5) or
(j=5) then stringgrid1.Cells[j,i]:='9';
end;
end;
end;
end.
Selamat Mencoba....
0 komentar:
Posting Komentar