Moving in the matrix
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ni david
le 28 Oct 2017
Réponse apportée : Walter Roberson
le 28 Oct 2017
Imagine I have a 4x4 chess board. How can I define the movements of the knight in this board?
0 commentaires
Réponse acceptée
Walter Roberson
le 28 Oct 2017
(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 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!