program tripsi; uses crt; var man,x,y,erinev,kokku,n,m,lopp,i:integer; abi:string; tekst:array[1..10] of string; mass:array[1..3,1..9] of integer; a,erinev1,NIMI1,nimi2,mangia:string; label 1; procedure kirjuta; begin textbackground(blue); textcolor(white); {window(5,30,45,70); writeln; } gotoxy(30,5); writeln(' I I '); gotoxy(30,6); writeln(' ____I____I____'); gotoxy(30,7); writeln(' I I '); gotoxy(30,8); writeln(' ____I____I____'); gotoxy(30,9); writeln(' I I '); gotoxy(30,10); writeln(' I I '); end; procedure tarn(kx,ky:integer); begin gotoxy(kx,ky);writeln('O '); end; procedure rist(kx,ky:integer); begin gotoxy(kx,ky);writeln('X'); end; procedure valikud; begin gotoxy(2,1); write('Teie valikud saavad olla jargnevad'); gotoxy(2,2); tekst[1]:='ruut nr.a11'; tekst[2]:='ruut nr.a12'; tekst[3]:='ruut nr.a13'; tekst[4]:='ruut nr.a21'; tekst[5]:='ruut nr.a22'; tekst[6]:='ruut nr.a23'; tekst[7]:='ruut nr.a31'; tekst[8]:='ruut nr.a32'; tekst[9]:='ruut nr.a33'; kokku:=9; erinev:=1; textbackground(green); textcolor(white); gotoxy(5,5); write(tekst[1]); textbackground(white); textcolor(green); for i:=1 to kokku do begin gotoxy(5,4+i); write(tekst[i]); end; end; procedure muuda(uus:integer); begin textcolor(green); textbackground(white); gotoxy(5,4+erinev); write(tekst[erinev]); erinev:=uus; textcolor(white); textbackground(green); gotoxy(5,4+erinev); write(tekst[erinev]); end; begin clrscr; for i:=1 to 50 do begin textcolor(green); gotoxy(i,10);writeln('TRIPS-TRAPS-TRULL'); sound(440); delay(20); textcolor(red); gotoxy(i,10); writeln('TRIPS-TRAPS-TRULL'); nosound; end; textmode(lastmode); clrscr; writeln('Sisestage mangija nr.1 oma nimi'); readln(nimi1); writeln('Sisestage mangija NR.2 oma nimi'); readln(nimi2); clrscr; repeat a:='y'; lopp:=1; for m:=1 to 3 do for n:=1 to 9 do mass[m,n]:=0; man:=2; repeat for n:=1 to 9 do if mass[3,n]=0 then{massiiv ei ole taidetud} begin {clrscr; } valikud; kirjuta; for m:=1 to 2 do {esimene on x mangija ja teine on 0 mangija} for n:=1 to 9 do if mass[m,n]>0 then begin if n=1 then begin x:=32; y:=5; end; if n=2 then begin x:=37; y:=5; end; if n=3 then begin x:=42; y:=5; end; if n=4 then begin x:=32; y:=7; end; if n=5 then begin x:=37; y:=7; end; if n=6 then begin x:=42; y:=7; end; if n=7 then begin x:=32; y:=9; end; if n=8 then begin x:=37; y:=9; end; if n=9 then begin x:=42; y:=9; end; if m=1 then tarn(x,y); if m=2 then rist(x,y); end; if man=2 then begin man:=1; mangia:=nimi1 end else begin man:=2; mangia:=nimi2;end; gotoxy(20,23); if man=1 then Writeln(nimi1,' sisestage oma valik '); if man=2 then Writeln(nimi2,' sisestage oma valik '); repeat repeat abi:=readkey; if abi=chr(0) then begin abi:=readkey; if abi='H' then begin if erinev > 1 then muuda(erinev-1) else muuda(kokku); end; if abi='P' then begin if erinev