Tugas Praktikum IV (Hal 212)
- Script:
program deteksiresolusimonitor;
{program untuk melihat resolusi grafis}
uses graph;
const
Theline = 'resolusi
anda adalah 640 x 480 x 256 colors!'+
'tekan enter untuk
melanjutkan';
var
gd, gm, lo, hi,
error,tw,th: integer;
found: boolean;
begin
gd:= D8bit;
gm:= m640x480;
initgraph(gd,gm,'');
error:= graphresult;
if (error <>
grOk) Then
begin
writeln('640x480x256
tidak didukung sistem!');
halt(1)
end;
setColor(cyan);
rectangle(0,0,getmaxx,getmaxy);
setTextstyle(defaultFont,horizDir,1);
tw:=textwidth(theline);
th:=TextHeight(theline);
outTextXY( (getmaxX -
tw) div 2, (getmaxY - th) div 2, theline);
readln;
closegraph;
end.
- Hasil:
Tugas Praktikum II (Hal 227)
- Script:
program
mendeteksimouse;
uses crt,mouse;
var
tombol: byte;
begin
clrscr;
Initmouse;
tombol:=detectmouse;
if tombol=0 then
writeln('Mouse tidak terdeteksi.')
else
Writeln('Terdapat mouse dengan jumlah
',tombol,' tombol');
Donemouse;
readln();
end.
Hasil:




