Created
November 10, 2014 14:41
-
-
Save imouaddine/8eb29c0a57732b5fab38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rotate_matrix(a, length) | |
(0).upto(length -1) do |i| | |
(i+1).upto(length -1) do |j| | |
a[i][j], a[j][i] = a[j][i], a[i][j] | |
end | |
end | |
a | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment