Skip to content

Instantly share code, notes, and snippets.

@ahoka ahoka/rot90.sml
Created Jan 26, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.