uses dos, crt; var h, m, s, sajandik, sekund, ha, ma, sa, aeg: word; x, y, kiirusx, kiirusy, kiirusax, kiirusay, ay, ax, z, k: real; arv, pommx, pommy, c, f, i, r, j: 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('<**>'); if pommy>0 then begin textcolor(black); gotoxy(pommx, pommy); writeln('.'); dec(pommy); textcolor(white); gotoxy(pommx, pommy); writeln('.'); end; x:=x+kiirusx; if x<7 then kiirusx:=abs(kiirusx); if x>70 then kiirusx:=-abs(kiirusx); y:=4; textcolor(white); gotoxy(round(x), round(y)); write('<**>'); { if pommy>0 then begin gotoxy(pommx, pommy); writeln('.'); textcolor(black); gotoxy(pommx, pommy); writeln('.'); end;} if (x<=pommx) and (x+4>=pommx) and (y=pommy) then begin sound(450); delay(50); nosound; delay(50); textcolor(white); end; { if (round(y)=15) and (round(x)>ax-3) and (round(x)'); textcolor(white); inc(arv); gotoxy(10, 23); write(arv); gotoxy(round(ax), 15); write('/=\'); x:=1; y:=1; kiirusx:=2.5*random+0.1; end;} end; procedure liiguta; var c: char; begin if keypressed then begin c:=readkey; if c=chr(27) then ots:=true; if c='m' then begin pommx:=round(ax); pommy:=21; end; if c=chr(0) then begin c:=readkey; if (c='K') then if (kiirusax<=0) then kiirusax:=kiirusax-0.1 else kiirusax:=-0.2; if (c='M') then if (kiirusax>=0) then kiirusax:=kiirusax+0.1 else kiirusax:=0.2; end; end; textcolor(black); gotoxy(round(ax), 22); write('/=\'); if ((ax+kiirusax>9) and (ax+kiirusax<60)) then ax:=ax+kiirusax else kiirusax:=0; textcolor(white); gotoxy(round(ax), 22); write('/=\'); end; {procedure shoot; var q: char; begin if keypressed then begin q:=readkey; if (q='m') then kiirusay:=-0.4 end; textcolor(black); gotoxy(round(ax), 21); write('.'); if ((ay+kiirusay>3) and (ay+kiirusay<75)) then ay:=ay+kiirusay textcolor(white); write('.'); end;} begin randomize; clrscr; textcolor(white); gotoxy(18, 12); writeln('Mitme tabamuseni soovid m„ngida? Piirajaks on 5 minutit.'); readln(r); gotoxy(30, 13); writeln('Laskmiseks kasuta "m"'); gotoxy(35, 14); writeln('Vajuta "ENTER".'); readln; clrscr; x:=10; y:=4; ax:=30; kiirusx:=0.6; kiirusy:=0.3; arv:=0; gotoxy(10, 23); write(arv); gettime(ha, ma, sa, sajandik); clrscr; gotoxy(round(ax), 22); write('/=\'); textcolor(black); kiirusax:=0.1; c:=0; textcolor(white); gotoxy(1, 1); writeln('Tabanud'); gotoxy(61, 1); writeln('Laske kokku'); f:=0; repeat; if pommy=20 then begin f:=f+1; gotoxy(73, 1); writeln(f); end; kell; liigu; liiguta; {shoot;} delay(50); if (x<=pommx) and (x+4>=pommx) and (y=pommy) then begin c:=c+1; gotoxy(9, 1); writeln(c); end; until ots or (c=r) or (aeg=300); textmode(lastmode); for j:=1 to 3 do begin for i:=200 to 600 do begin sound(i); delay(5); nosound; end; end; k:=(c/f)*100; gotoxy(25, 12); writeln('Sinu tabavusprotsent oli:', k:2:0, '%'); readkey end.