ユーザーが同じ座標を2回入力したかどうかを確認するコードを書くのを手伝ってくれる人はいますか?
コードの一部:
rc = input('Enter your next move [row space column]: ');
row = rc(1); %users coordinates
col = rc(2);
if row<0 || col<0
disp('Please enter positive coordinates');
rc = input('Enter your next move [row space column]: ');
row = rc(1);
col = rc(2);
end
if row>size || col>size
disp('Please enter cordinates with in the game board');
rc = input('Enter your next move [row space column]: ');
row = rc(1);
col = rc(2);
end
正の値と大きすぎる値を既に確認しましたが、ユーザーが同じ座標を 2 回入力していないことを確認し、エラー メッセージが表示されているかどうかを確認したいと思います。どんな助けでも大歓迎ですありがとう