uses dos, crt; var h, m, s, sajandik, sekund, ha, ma, sa, aeg: word; x, kiirusx, y, kiirusy, kiirusax, ax: real; arv: integer; ots: boolean; procedure kell; begin gettime(h, m, s, sajandik); if not (s=sekund) then begin sekund:=s; gotoxy(60, 23); write(h:2,':',m:2,':',s:2); aeg:=3600*(h-ha)+60*(m-ma)+s-sa; gotoxy(60, 24); write(aeg); end; end; procedure liigu; begin textcolor(black); gotoxy(round(x), round(y)); write('*+-'); x:=x+kiirusx; y:=y+kiirusy; if x<3 then kiirusx:=abs(kiirusx); if x>75 then kiirusx:=-abs(kiirusx); if y<3 then kiirusy:=abs(kiirusy); if y>21 then kiirusy:=-abs(kiirusy); textcolor(white); gotoxy(round(x), round(y)); write('*+-'); if (round(y)=15) and (round(x)>ax-3) and (round(x)=0) then kiirusax:=kiirusax+0.1 else kiirusax:=0.2; end; end; textcolor(black); gotoxy(round(ax), 15); write('|-|'); if ((ax+kiirusax>3) and (ax+kiirusax<75)) then ax:=ax+kiirusax else kiirusax:=0; textcolor(white); gotoxy(round(ax), 15); write('|-|'); end; begin randomize; x:=10; y:=3; ax:=30; kiirusx:=0.6; kiirusy:=0.3; arv:=0; gotoxy(10, 23); write(arv); gettime(ha, ma, sa, sajandik); clrscr; gotoxy(round(ax), 15); write('|-|'); kiirusax:=0.1; repeat; kell; liigu; liiguta; delay(10); until ots; textmode(lastmode); end.