I have to use a matrice that represents the game table
disp( ' ====================== OTHELLO GAME ============================= ' )part=input('select the number of part ');for p=1:1:part disp(['PART',num2str(p)]) m=[3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 1 3 3 3 3 3 3 1 0 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3] disp('Player 1')I=1;J=1;for i=I-1:I+1 for j=J-1:J+1 i=input('choose the row number please '); j=input('choose the column cnumber please '); if ((ne(i,I)&&(ne(j,J)))||(i==0)||(i==J+1)||(j==0)||(j==J+1)) disp('no possible') if (m(i,j)==0) for l=1:8 l=-1; c=0; while (m(i,j)~=1) m(i,j)=0; i=i+l; j=j+c; end end end end endendend
There is errors, I'm blocked
Best Answer