Zone Game - Dota 2 Indonesia, Tips, Guide, Tutorial, Download Cheat, Cheat PS3, Rank Hero Dota 2, Item Build, Perfect World

Contoh Membuat Bintang dalam Pascal



Program cara Membuat Bintang Di Pascal...

program Bintang;
uses crt, graph;
type Tbintang = Record
PX, PY : Integer;
Ukuran : Integer;
Warna : Integer;
end;
Var BT : TBintang;
Procedure Create_Bintang(Var B:Tbintang;X, Y, U, W: Integer);
begin
B.PX := X;
B.PY := Y;
B.Ukuran := U;
B.Warna := W;
setcolor(B.Warna);
Moveto(B.PX, B.PY-4*B.Ukuran);
Lineto(B.PX+1*B.Ukuran, B.PY-1*B.Ukuran);
LineTo(B.PX+4*B.Ukuran, B.PY-1*B.Ukuran);
LineTo(B.PX+2*B.Ukuran, B.PY+1*B.Ukuran);
LineTo(B.PX+3*B.Ukuran, B.PY+4*B.Ukuran);
Lineto(B.PX, B.PY+2*B.Ukuran);
LineTo(B.PX-3*B.Ukuran, B.PY+4*B.Ukuran);
LineTo(B.PX-2*B.Ukuran, B.PY+1*B.Ukuran);
Lineto(B.PX-4*B.Ukuran, B.PY-1*B.Ukuran);
LineTo(B.PX-1*B.Ukuran, B.PY-1*B.Ukuran);
Lineto(B.PX, B.PY-4*B.Ukuran);
end;

procedure InisialisasiGrafik;
var
DriverGrafik,ModeGrafik : integer;
begin
DriverGrafik:=VGA;
ModeGrafik:=VGAHi;
initgraph(DriverGrafik,ModeGrafik,' ');
end;

Begin
clrscr;
InisialisasiGrafik;
Repeat
BT.PX :=(315);
BT.PY :=(200);
BT.Ukuran := Random(30);
BT.Warna := (green);
Create_Bintang(BT, BT.PX, BT.PY, BT.Ukuran, BT.Warna);
delay(10000);
until keypressed;
readln;
closegraph
End.

Mudah2 dapat Membantu Tmn2 dalam belajar Pascall ^_^

Source from : Indonesian Hacker


@



0 comments:

Post a Comment - Kembali ke Konten

Contoh Membuat Bintang dalam Pascal