Moving in the matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Imagine I have a 4x4 chess board. How can I define the movements of the knight in this board?
0 件のコメント
採用された回答
Walter Roberson
2017 年 10 月 28 日
(I,J) ->
(I-1,J-2)
(I-1,J+2)
(I+1,J-2)
(I+1,J+2)
(I-2,J-1)
(I-2,J+1)
(I+2,J-1)
(I+2,J+1)
and then filter out the ones that went out of bounds.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!