אם תבין מזה משהו סבבה
ומה זה מערך דו מימדי?uses crt;
var
finish,a1,a2,a3,b1,b2,b3,c1,c2,c3:char;
player,one,two:integer;
procedure nooption;
begin
writeln('no such option');
if player=1 then player:=2 else player:=1;
end;
begin
repeat
clrscr;
if player=1 then player:=2 else player:=1;
writeln(' 1 2 3');
writeln('1 ',a1,'#',a2,'#',a3);
writeln(' ##');
writeln('2 ',b1,'#',b2,'#',b3);
writeln(' ##');
writeln('3 ',c1,'#',c2,'#',c3);
writeln('');
writeln('player ',player,' it is you turn:');
read(one);
read(two);
while player=1 do begin
if (one=1) and (two=1) then a1:='x' else
if (one=1) and (two=2) then a2:='x' else
if (one=1) and (two=3) then a3:='x' else
if (one=2) and (two=1) then b1:='x' else
if (one=2) and (two=2) then b2:='x' else
if (one=2) and (two=3) then b3:='x' else
if (one=3) and (two=1) then c1:='x' else
if (one=3) and (two=2) then c2:='x' else
if (one=3) and (two=3) then c3:='x' else
nooption;
end;
while player=2 do begin
if (one=1) and (two=1) then a1:='0' else
if (one=1) and (two=2) then a2:='0' else
if (one=1) and (two=3) then a3:='0' else
if (one=2) and (two=1) then b1:='0' else
if (one=2) and (two=2) then b2:='0' else
if (one=2) and (two=3) then b3:='0' else
if (one=3) and (two=1) then c1:='0' else
if (one=3) and (two=2) then c2:='0' else
if (one=3) and (two=3) then c3:='o' else
nooption;
end;
readkey;
until finish='v'
end.