Created
January 26, 2016 10:53
-
-
Save ahoka/1e038c287b4ba0693165 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
val m = [[1, 2, 3], [6, 5, 4]]; | |
fun rot90 (matrix) = | |
let | |
fun rot90 (m, acc) = | |
if null (hd m) then | |
rev acc | |
else | |
rot90 (map tl m, map hd m :: acc) | |
in | |
rot90 (matrix, nil) | |
end; | |
rot90 (m) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment