MATLAB: How to create Without GUI an algorithm for Reversi (Game) or Othello using matrice function

gameothelloothello_matricereversi

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
end
end
end
There is errors, I'm blocked

Best Answer

I'm not going to write a whole game for you and I believe any game like that is going to be much much longer than 50 lines or so. You didn't even tell us what the errors were and when I copied and pasted, no errors were thrown.
So look to the File Exchange for similar programs people have uploaded.