uses crt, graph; var nimi, vastus, ei: string; d, m, i, x, y, z, r, kiirusx, kiirusy, x1, y1 : integer; s: char; procedure kirjuta(kx, ky: integer); begin gotoxy(kx, ky ); writeln('***'); gotoxy(kx, ky+1); writeln('***'); end; procedure kirj(kx, ky: integer); begin gotoxy(kx, ky); writeln('***'); end; { procedure kirjutaA (kx, ky: integer); begin gotoxy(kx, ky ); writeln('K'); gotoxy(kx, ky+1); writeln('U'); gotoxy(kx, ky+2); writeln('S'); gotoxy(kx, ky+3); writeln('T'); gotoxy(kx, ky+4); writeln('U'); gotoxy(kx, ky+5); writeln('T'); gotoxy(kx, ky+6); writeln('A'); end;} begin writeln('Mis su nimi on?'); readln(nimi); clrscr; insert(' Kallis ', nimi,1); TextColor(yellow); writeln('Tere,', nimi,'! Kas sa tahad natuke mngida?'); readln(vastus); if vastus<>'ei' then begin gotoxy(20, 10); writeln('Nd alustame!'); readln; begin begin clrscr; d:=detect; initgraph(d, m, ''); x:=34; z:=200; r:=15; for i:=1 to 100 do begin setcolor(red); circle(x, z, r); delay(25); r:=r+1; x:=x+5; end; closegraph; end; clrscr; x:=3; y:=5; kirj(x, y); x1:=3; y1:=3; kiirusx:=1; kiirusy:=2; repeat if keypressed then begin s:=ReadKey; textcolor(black); kirj(x, y); if s=chr(0) then begin s:=readkey; if (s='K') and (x>3) then x:=x-1; if (s='M') and (x<75) then x:=x+1; if (s='H') and (y>3) then y:=y-1; if (s='P') and (y<18) then y:=y+1; end; textcolor(white); kirj(x,y); end; if y1<3 then kiirusy:=abs(kiirusy); if y1>15 then kiirusy:=-abs(kiirusy); y1:=y1+kiirusy; if x1<5 then kiirusx:=abs(kiirusx); if x1>60 then kiirusx:=-abs(kiirusx); x1:=x1+kiirusx; textcolor(yellow); kirjuta(x1, y1); delay(60); textcolor(black); kirjuta(x1, y1); until ((x=x1) and (y=y1)) or (s=chr(27));TextMode(LastMode); end; end else writeln('Mul on vga kahju, et sa ei taha minuga mngida.'); readln; end.