Skip to content

Instantly share code, notes, and snippets.

@ahoka ahoka/rot90.fs
Created Jan 27, 2016

What would you like to do?
let rot90 m =
let rec rot90 m acc =
if List.isEmpty <| List.head m then
List.rev acc
rot90 ( List.tail m) ( List.head m :: acc)
rot90 m []
let matrix = [[1; 2; 3;];
[6; 5; 4]]
let matrix' = rot90 matrix
List.iter (printfn "%A") matrix'
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.