home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 March
/
Chip_1998-03_cd.bin
/
ctenari
/
NoWork
/
PASCAL
/
G_TIME.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-12-30
|
3KB
|
141 lines
{Public domain program od firmy NoWork Computer Systems}
program setric;
uses crt,graph,dos;
var a,b,c,gd,gm,mx,my,x,y:integer;
h, m, s, hund : Word;
var buttons, j, k, l, n : word;
label 1;
function reset : word;
var r : registers;
begin
r.ax:=0;
intr($33,r);
reset:=r.ax;
end;
procedure dispmouse;
var r : registers;
begin
r.ax:=1;
intr($33,r);
end;
procedure remvmouse;
var r : registers;
begin
r.ax:=2;
intr($33,r);
end;
procedure query(var buttons, x, y : word);
var r : registers;
begin
r.ax:=3;
intr($33,r);
buttons:=r.bx;
x:=r.cx;
y:=r.dx;
end;
function LeadingZero(w : Word) : String;
var
s : String;
begin
Str(w:0,s);
if Length(s) = 1 then
s := '0' + s;
LeadingZero := s;
end;
begin
gd:=detect;
initgraph(gd,gm,'c:\bp\bgi');
if GraphResult <> grOk then begin
sound(800);delay(200);nosound;
clrscr;
gotoxy(1,10);
writeln('ERROR: Graficky driver nebyl nalezen!!');
writeln('Nebyl nalezen soubor egavga.bgi.');
writeln('Skontrolujte jestli se nachazi v tomto adresari.');
halt(1);
end;
j:=j shr 3+1;
k:=k shr 3+1;
repeat
Setcolor(red);
SetTextStyle(DefaultFont, HorizDir ,1 );
OutTextXY(5,450, '(c) NoWork Computer Systems 1996.');
a:=random(450);
b:=random(410);
c:=random(16);
setcolor(c);
SetTextStyle(UserCharSize, HorizDir ,5 );
GetTime(h,m,s,hund);
OutTextXY(a,b,LeadingZero(h));
OutTextXY(a+70,b-3 ,':');
OutTextXY(a+105,b,LeadingZero(m));
delay(30);
setcolor(c);
SetTextStyle(UserCharSize, HorizDir ,5 );
GetTime(h,m,s,hund);
OutTextXY(a,b,LeadingZero(h));
OutTextXY(a+70,b-3 ,':');
OutTextXY(a+105,b,LeadingZero(m));
delay(30);
setcolor(white);
SetTextStyle(UserCharSize, HorizDir ,5 );
GetTime(h,m,s,hund);
OutTextXY(a,b,LeadingZero(h));
OutTextXY(a+70,b-3 ,':');
OutTextXY(a+105,b,LeadingZero(m));
delay(50);
setcolor(c);
SetTextStyle(UserCharSize, HorizDir ,5 );
GetTime(h,m,s,hund);
OutTextXY(a,b,LeadingZero(h));
OutTextXY(a+70,b-3 ,':');
OutTextXY(a+105,b,LeadingZero(m));
delay(30);
setcolor(c);
SetTextStyle(UserCharSize, HorizDir ,5 );
GetTime(h,m,s,hund);
OutTextXY(a,b,LeadingZero(h));
OutTextXY(a+70,b-3 ,':');
OutTextXY(a+105,b,LeadingZero(m));
delay(30);
cleardevice;
Setcolor(red);
SetTextStyle(DefaultFont, HorizDir ,1 );
OutTextXY(5,450, '(c) NoWork Computer Systems 1996.');
delay(200);
l:=l shr 3+1;
n:=n shr 3+1;
query(buttons, j, k);
if buttons and 1 = 1 then goto 1;
if buttons and 2 = 2 then goto 1;
until keypressed;
1: closegraph;
end.