Вот есть будильник, ктонибуть может написать алгоритм программы?
А как можно сделать чтобы было 6 цифровых разрядов под числа(часы, минуты, секунды)? кто сможет, напишите пожалуйста
код программы
Код: Выделить всё
uses crt,dos;
var regs:registers;
h,m,s,h1,m1,s1:byte;
procedure cursoroff;assembler;
asm mov ah,1
mov ch,20h
int 10h
end
procedure alarm;
var f:integer;
begin clrscr;
gotoxy(24,12);
textcolor(lightred);
writeln('nagmite klavichu chtobi ostanivit chasi ...');
cursoroff;
repeat f:=695;
sound(f);
delay(100);
while f>671 do
begin dec(f);
sound(f);
delay(100);
end;
f:=588;
sound(f);
delay(300);
while f<610 do
begin sound(f);
delay(150);
inc(f);
end;
until keypressed;
nosound;
end;
begin textbackground(black);
clrscr;
textcolor(lightblue);
repeat gotoxy(57,10);write(' ');
gotoxy(14,10);
write('Vvedite chas budilnika (0...23) : ');
readln(h);
until (h>=0)and(h<24);
repeat gotoxy(57,12);write(' ');
gotoxy(14,12);
write('Enter minutes of your alarm-clock (0...59) : ');
readln(m);
until (m>=0)and(m<60);
repeat gotoxy(57,14);write(' ');
gotoxy(14,14);
write('Enter seconds of your alarm-clock (0...59) : ');
readln(s);
until (s>=0)and(s<60);
clrscr;
gotoxy(20,3);
textcolor(lightmagenta);
gotoxy(23,12);
write('Time in your BIOS-clock now is ');
textcolor(yellow);
gotoxy(25,10);
write('Alarm-clock been starting at ');
if h<10 then write('0',h,':')
else write(h,':');
if m<10 then
write('0',m,':')
else write(m,':');
if s<10 then
write('0',s)
else write(s);
textcolor(green);
gotoxy(16,14);
writeln('Press any key for exit before alarm-clock been started.');
repeat
regs.ah:=$2c;
intr($21,regs);
with regs do
begin gotoxy(54,12);
textcolor(lightmagenta);
h1:=ch;
if ch<10 then write('0',ch,':')
else write(ch,':');
m1:=cl;
if cl<10 then
write('0',cl,':')
else write(cl,':');
s1:=dh;
if dh<10 then
write('0',dh)
else write(dh);
end;
cursoroff;
until (keypressed)or((h=h1)and(m=m1)and(s=s1));
if ((h=h1)and(m=m1)and(s=s1)) then alarm;
end.